【发布时间】:2019-11-26 18:22:53
【问题描述】:
我在后端有一个使用 React 和 ASP.NET Core 2.1 WebAPI 构建的单页应用程序。我正在切换到将 auth0 令牌从 localstorage 存储到 httponly cookie,并且无法访问存储在服务器上 httponly cookie(由客户端/浏览器设置)中的 auth0 令牌。
我将我的 auth0 令牌存储在 cookie 中,并将其发送到服务器进行验证。当 httponly 标志为 false 时,我能够访问 auth0 令牌,但是当设置为 true 时,我无法访问令牌。我尝试实现一个中间件来检查相同的内容,发现当 http only 为真时令牌不可见。
【问题讨论】:
标签: cookies asp.net-web-api2 auth0 httponly cookie-httponly