gpt4 book ai didi

javascript - 在 Chrome 77 上尝试针对 google recaptcha v2 警告的 SameSite 属性修复似乎对我不起作用?

转载 作者:行者123 更新时间:2023-11-30 13:50:37 26 4
gpt4 key购买 nike

如果我重复这个问题,我深表歉意,但我已经花了 6 天多的时间来解决这个问题,我已经失去理智了。我似乎无法让警告消失,即使我已经仔细尝试并重试将它们添加到我的 php 索引中和标签之前。我试过帖子 SameSite warning Chrome 77使用

response.setHeader("Set-Cookie", "HttpOnly;Secure;SameSite=Strict");

以及这里的帖子 How to solve `SameSite` attribute使用

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

以及这里的例子 https://github.com/GoogleChromeLabs/samesite-examples/blob/master/php.md

即使其他一切都没有改变,我仍然收到警告。我错过了什么或做错了什么吗?抱歉,我想这应该没什么大不了的,但我对这些弹出的警告消息和错误非常反感,我希望它们会消失!提前致谢。

-update- 抱歉,在有问题的控制台中弹出的警告是这样的

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.

最佳答案

该警告专门针对来自“google.com”的 cookie,因此您无法影响它。如果任何控制台警告涉及您控制的域,那么您应该按照该建议更新您的 SameSite 属性。

这确实意味着您将继续看到这些警告,直到受影响的域更新其 cookie,这应该会在未来几个月内发生。直到 Chrome 80 才计划执行此行为,Chrome 80 将在 2 月份稳定。因此,在此之前,稳定版 Chrome 中的实际网站/服务功能不应受到影响。

关于javascript - 在 Chrome 77 上尝试针对 google recaptcha v2 警告的 SameSite 属性修复似乎对我不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58328542/

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