Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Codeigniter 3 SameSite attribute for csrf protection

I have applications that make CORS calls to each other. Google in April 2020 will need SameSite cookies = none. https://www.chromestatus.com/feature/5633521622188032

Since chrome version 80+ all user that use chrome browser impact this csrf error. how to fix this problem on Codeigniter framework that using PHP 7.3

enter image description here

like image 802
Panup Pong Avatar asked Oct 17 '25 13:10

Panup Pong


1 Answers

I had this same problem but my PHP 7.2 and my CI 3.X. The problem was solved by making the following change to the applications / config / config.php file

$config['cookie_prefix']    = '';
$config['cookie_domain']    = ''; 
$config['cookie_path']      = '/; SameSite=None';
$config['cookie_secure']    = TRUE;
$config['cookie_httponly']  = FALSE;
like image 125
Wilker Alves Avatar answered Oct 19 '25 08:10

Wilker Alves



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!