有什么方法可以在会话 cookie 上设置 "SameSite" 属性 吗?

Is there any way to set the "SameSite" property on a session cookie?

我的 cookie 上 Chrome 和“samesite”属性 有问题(我通过 PHP 在云服务器上登录,然后使用我的资源另一个域中的云服务器)

在我自己创建的 cookie 上,我可以:

setcookie("foo", "bar", [
   "expires" => time() + 60 * 60 * 24,
   "path" => "/",
   "domain" => "", 
   "secure" => true,
   "httponly" => false,
   "samesite" => 'None'
  ]);

这行得通。

我的问题是,有没有办法在我的“PHPSESSID”会话 cookie 上也添加“samesite”=> 'None',这样我就可以使用来自跨域的会话页数?

这是一个 chrome 特定问题

您可以通过更改 php.ini 中的 session.cookie_samesite 来配置它。

详情here