cakePHP为SameSite属性设置Cookies。但我无法在代码中找到它/无法找到它 [英] cakePHP set Cookies for SameSite Attribute. But I can't find it in the Code/track it down

查看:102
本文介绍了cakePHP为SameSite属性设置Cookies。但我无法在代码中找到它/无法找到它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我仍在成为开发人员。首先,我无法显示与此问题相关的任何代码,因为不允许这样做...

I'm still becoming a developer. First of all I can't show any code related to this problem because I'm not allowed to do so...

使用Chrome的新Cookie策略(和其他)必须将 SameSite 属性设置为无。

With the new cookie policy from Chrome (and others) the SameSite attribute must be set to None.

我的问题是,我找不到任何设置cookie的代码。它来自服务器。我搜索了我目前所在公司的git存储库。
我在互联网上搜索了所有可能的解决方案。问题是找到合适的位置。代码是用php编写的,到目前为止我还没有学过。

My problem is, that I can't find any code where the cookies are set. It comes from a server. I searched the git repositories of the company I'm currently at. I searched the internet for every solution possible. The problem is finding the right place to put it in. The code is written in php which I haven't learned so far.

该cookie来自另一个网站,并且我无法找到它。

The said cookie comes from another website and I unable track it down.

推荐答案

蛋糕3.5.8

在您的config / app.php文件中,将以下行添加到Session ['ini']部分:

In your config/app.php add the following lines into the Session['ini'] section:

'Session' => [
        'ini' => [
           'session.cookie_samesite' => 'None',
           'session.cookie_secure' => true
       ]
],

这篇关于cakePHP为SameSite属性设置Cookies。但我无法在代码中找到它/无法找到它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆