使用百度统计后,Chrome浏览器报错跨站点资源相关联的cookie被设置为不具有“ SameSite”属性


A cookie associated with a cross-site resource at http://hm.baidu.com/ was set without the `SameSite` attribute. It has been blocked, as Chrome now only delivers 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.

与http://baidu.com/上的跨站点资源相关联的cookie被设置为不具有“ SameSite”属性。它已被阻止,因为Chrome现在仅在跨站点请求中将Cookie设置为“ SameSite = None”和“ Secure”时才发送。您可以在“应用程序”>“存储”>“ Cookies”下的开发人员工具中查看Cookie,并在https://www.chromestatus.com/feature/5088147346030592和https://www.chromestatus.com/feature/5633521622188032上查看更多详细信息。

response.setHeader 在哪儿设置 lnmp?

解决办法:
在header.php文件顶部加入

1
<?php header("Set-Cookie: key=value; path=/; domain=*.xxxx.com; Secure; SameSite=None"); ?>
原文链接:https://xiaohost.com/3709.html,转载请注明出处。
0

评论0

请先