I am using Nodejs as Backend and Angular for front-end, I am trying to use cookies.
I am using the following code to set cookies:
const conf = {
signed: true,
path: "/",
secure: false,
maxAge: 60*60*10000000,
httpOnly: false,
};
app.use(cookieParser());
res.cookie('name', 'val', conf);
When I use the same in local server, I can see Cookies being set in Chrome Dev-Tools Application. When I deploy, the cookies are not visible in my angular application. But the cookies are set, I don't know why they are not visible in browser also not accessible by javascript.
When I send a request from angular with withCredentials:true
, with a debug statement in node server, console.log(req.headers.cookie)
- I get the cookie.
But why the cookie is not showing in Browser.