【发布时间】:2020-02-08 05:32:52
【问题描述】:
如果我要重复这个问题,我深表歉意,但我已经在这个问题上花费了 6 多天,我正在失去理智。即使我已经仔细尝试并重试将这些警告添加到我的 php 索引中的 and 标记之前,我似乎也无法让该警告消失。我试过帖子 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.
【问题讨论】:
-
有人吗?一定有人知道如何让这个警告消失......
标签: javascript php google-chrome cookies samesite