如果我重复这个问题,我深表歉意,但我已经花了 6 多天的时间,我正在失去理智。即使我已经仔细尝试并重试将这些添加到我的 php 索引中和标签之前,我似乎无法让该警告消失。我试过在SameSite上 发帖警告 Chrome 77 使用
response.setHeader("Set-Cookie", "HttpOnly;Secure;SameSite=Strict");
Run Code Online (Sandbox Code Playgroud)
以及此处的帖子 如何解决 要使用的“SameSite”属性
header('Set-Cookie: cross-site-cookie=name; SameSite=None; Secure');
Run Code Online (Sandbox Code Playgroud)
以及这里的示例 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.
Run Code Online (Sandbox Code Playgroud)