How to set SameSite=None header in php

Shopify Partner
9 0 1

Hello All,


I got notification from Shopify regarding chrome update for SameSite attribute. 


I have created an app on php- Codeigniter framework. I am tried following ways but none of them worked. My php version is 7.1


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 also tried the same one but it didn't work at all. Can you please help me. It is urgent.

New Member
2 0 0

Found this thread and it resolve the issue. 

Have you already fixed it? We have the same problem. My application no longer work inside the iframe. The issue is when inside the iframe the session no longer works via ajax call. 
I tired to add header.  

header('Set-Cookie: cross-site-cookie=bar; SameSite=None; Secure');

 I'm stuck  fixing this issue :( my last option would be open the application outside the shopify.


Shopify Partner
9 0 1

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


Hope this will help you 

Shopify Partner
375 46 75

Hi @dhara-pawar 
what about Incompatible browser? I think this is supported only in chrome 80+
will it affect to other browsers? how did you managed it?

If helpful then please Like and Accept Solution.
Skype: jivan.suhagiya
Give a try to Shopify APP: