我使用 Laravel 5.8.17 在我的网站上的 iframe 中加载 YouTube 视频。窥视控制台,我收到此警告:
A cookie associated with a cross-site resource at http://youtube.com/ was set without the
SameSite
attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set withSameSite=None
andSecure
. 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.
我现在将我的 'samesite' session.php 设置为:
'same_site' => "lax", // was null before
但我仍然收到警告。我该如何正确解决这个问题?
最佳答案
对于这些警告中的任何一个,如果您不对域负责,则您不负责更新 cookie。 YouTube 团队将负责更新设置 SameSite
的相关代码。来自 youtube.com
的 cookie 属性.
此时,警告纯粹是信息性的,不会影响功能。在稳定的 Chrome 中强制执行此行为直到 M80,目前目标是 2020 年 2 月。
关于php - 如何在 Laravel 5.8 中为 YouTube 设置 SameSite cookie,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58489796/