Php: Set header for cookie attribute SameSite=None;Secure is not working at all Php: Set header for cookie attribute SameSite=None;Secure is not working at all codeigniter codeigniter

Php: Set header for cookie attribute SameSite=None;Secure is not working at all


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)

Header always edit Set-Cookie ^(.*)$ $1;Secure;SameSite=None


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

if(isset($_COOKIE["PHPSESSID"])){    header('Set-Cookie: PHPSESSID='.$_COOKIE["PHPSESSID"].'; SameSite=None');}

It worked for me, after trying it all (in vain)