谷歌浏览器SameSite 问题

SameSite总共有三个值:Strict、Lax、None

谷歌浏览器80版本后,默认值改为Lax, 导致响应cookie中未指定该值的网站,会出现js加载不上的问题:具体可能报类似错误:  cookie associated with a cross-site resource at http://baidu.com/ 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.

解决办法: 

1. 服务端设置指定cookie属性SameSite=None

2.浏览器:chrome://flags/#same-site-by-default-cookies, 禁用SameSite by default cookies和Cookies without SameSite must be secure两项, 重启即可

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容