美文网首页
谷歌浏览器SameSite 问题

谷歌浏览器SameSite 问题

作者: Mikey扬 | 来源:发表于2020-09-26 21:25 被阅读0次

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两项, 重启即可

相关文章

网友评论

      本文标题:谷歌浏览器SameSite 问题

      本文链接:https://www.haomeiwen.com/subject/yaehuktx.html