【发布时间】:2020-02-02 08:20:50
【问题描述】:
即使我的 express 应用程序具有以下设置,控制台中仍会显示以下警告。有没有人见过这个错误?我的搜索将我带到https://github.com/expressjs/express/issues/3095
我也在使用 express : 4.17.1
let COOKIE_OPTIONS = { httpOnly: true, sameSite: 'None', secure: true };
A cookie associated with a cross-site resource at http://MYURL.URL was set
without the `SameSite` attribute. A future release of Chrome will only deliver
cookies with cross-site requests if they are set with `SameSite=None` and
`Secure`. You can review cookies in developer tools under
Application>Storage>Cookies and see more details at
https://www.chromestatus.com/feature/5088147346030592 and
https://www.chromestatus.com/feature/5633521622188032.
当使用 Insomia (Postman) 发出请求时,我看到以下内容
access_token=someToken;
Path=/;
HttpOnly;
Secure;
SameSite=None
【问题讨论】:
-
问题可能与通过 HTTPS 而不是我目前使用的 HTTP 提供 cookie 相关。
-
经过测试,发现它也适用于 HTTP。
标签: javascript node.js express cookies