I know there is many solutions given regarding the same question but I tried all of them and none of them working at all.
I am tried following ways but none of them worked. My php version is 7.1 and Codeigniter framework I am using.
By setting header in index.php
header('Set-Cookie: HttpOnly; SameSite=None;Secure');
By setting in .htaccess
Header edit Set-Cookie ^(.*)$ "$1;HttpOnly;Secure;SameSite=none"
By setting in apache2 httpd.conf
Header edit Set-Cookie ^(.*)$ "$1;HttpOnly;Secure;SameSite=None"
I have reviewed Chrmoe git updates, it says
header('Set-Cookie: cross-site-cookie=bar; SameSite=None; Secure');
I didn’t get the option cross-site-cookie=bar
. What will be value for it.
I also tried the same one but it didn’t work at all.
4
Answers
Hello I have solved this issue by following. Hope it will help to others
In httpd.conf (For bitnami server file will be /opt/bitnami/apache2/conf)
This might also help for someone still struggling, and using PHP >= 7.3.x and using CI 3.1.11
In the index.php found in the root, add the code below <?php
It worked for me, after trying it all (in vain)
Paste the code below in your .htaccess file
This worked for me:
sudo nvim /etc/apache2/conf-available/security.conf
Header set Set-Cookie "mycookie=myvalue; Domain=mydomain.com; Path=/; Secure; HttpOnly; SameSite=Strict"
sudo systemctl restart apache2