admin管理员组文章数量:1642186
Google 发布的 Chrome 80 中,在所有的 Cookie 中默认设置 SameSite=Lax 来屏蔽所有的第三方 Cookie,详见 Cookies default to SameSite=Lax;并拒绝所有的非 Secure 的Cookie 设为 SameSite=None,详见 Reject insecure SameSite=None cookies
关于 SameSite 属性的介绍,可参考阮一峰的《Cookie 的 SameSite 属性》
目前项目中已经出现了部分 chrome 80 浏览器下,无法访问原本通过 iframe 形式嵌入的页面,并在控制台报如下错误:
A cookie associated with a cross-site resource at http://ip/ 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/feature/5088147346030592 and https://www.chromestatus/feature/5633521622188032.
解决方案可参考:https://yq.aliyun/articles/743364
目前不是所有的 chrome 80 版本都会出现该问题,仅对部分用户生效,可以通过访问测试地址查看自己的 chrome 在跨站(cross-site)的情况下是否已经无法 set cookie。
注:测试地址中主要看 cookie 是 set
还是 not set
,不要被 ✘ 吓到,如果所有行都显示绿色✔,只是说明您的浏览器正在实施新行为,但这个不重要。
samesite 只识别是否跨站,即是否为相同 IP 。具体地讲,我们将“同一站点”定义为根域名(例如,geekbang)加上协议(例如,https:// 或者 http://)。
版权声明:本文标题:关于 chrome 80 后出现的 SameSite 问题 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/dianzi/1729333589a1196701.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论