admin管理员组文章数量:1123401
What is the difference between an HTTP response cookie (specifically in the Firefox console window) and the cookies in Storage? I'm attempting to return a CSRF token as a cookie from express to an angular frontend, like so:
const options = {
httpOnly: true,
secure: false, // set to false for local testing
sameSite: "lax",
// maxAge: oneDayToSeconds,
domain: 'localhost'
};
return res.status(200).cookie('XSRF-TOKEN', csrfToken, options).end();
I'd expect this to store the cookie in the browser storage, here:
but nothing gets stored. If I check the response headers section and the cookies section for the response, I can see the following:
and the cookies section:
I can see the token.
What is the difference between the two cookie sections and shouldn't this approach automatically store the cookie value?
Thanks
本文标签:
版权声明:本文标题:angular - What is the difference between cookies in the response headers and the storage cookies? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736567694a1944728.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论