gpt4 book ai didi

php - 如何解决 `SameSite`属性

转载 作者:搜寻专家 更新时间:2023-10-31 08:22:29 51 4
gpt4 key购买 nike

我查看了控制台并注意到了这些警告

A cookie associated with a cross-site resource at http://google.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.

如何解决?

最佳答案

对我有用的解决方案:

如果您使用的是 PHP,将此行添加到开头

header('Set-Cookie: cross-site-cookie=name; SameSite=None; Secure');


更新这是一个有用的资源,包括 JavaScript、Node.js、PHP 和 Python 中的示例
https://github.com/GoogleChromeLabs/samesite-examples

关于php - 如何解决 `SameSite`属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58211114/

51 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com