php - 如何在 Laravel 5.8 中为 YouTube 设置 SameSite cookie

标签 php laravel-5 cookies youtube samesite

我使用 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 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.



我现在将我的 '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/

相关文章:

PHP 列出数组名称和值

php - 工作流困惑 : PayPal Cordova Plugin/Magento

javascript - CSS 冲突。 CSS 更改了我的 <select> 类

php - POST 到 Laravel Passport 路由以创建客户端时出现 419 错误

javascript - 使用 JavaScript 启用/禁用按钮

php - PHP Curl 中的 cookiejar

php - 从具有错误字符集的 MySQL 列中抢救希伯来语

php - 如何在 MySQL 和 PHP 中选择没有日期的年份?

php - 干净地 emogrify Laravel Blade 模板文件的最佳方法是什么?

java - 如何从 android.webkit.CookieManager 获取 httpOnly cookie