Since Chrome 79 session "lost" after redirect Since Chrome 79 session "lost" after redirect google-chrome google-chrome

Since Chrome 79 session "lost" after redirect


Faced the same issue.turn out that it is related to Microsoft.

Adding CookieSameSite="NONE" in WebConfig will probably solve your problem.

I added this in my config and it solved the issue.

<system.webServer>  <rewrite>  <outboundRules>    <clear />    <rule name="Add SameSite" preCondition="No SameSite">      <match serverVariable="RESPONSE_Set_Cookie" pattern=".*" negate="false" />      <action type="Rewrite" value="{R:0}; SameSite=None" />      <conditions> </conditions>    </rule>    <preConditions>      <preCondition name="No SameSite">        <add input="{RESPONSE_Set_Cookie}" pattern="." />        <add input="{RESPONSE_Set_Cookie}" pattern="; SameSite=None" negate="true" />      </preCondition>    </preConditions>  </outboundRules></rewrite>


I was strugling with the same issue. I found a good article on this. samesite=none cookies The article is written fo ASP.NET users.

I'm working in php. But the stuff is also relevant to php.

Only there you should use another methods. Methods also depend on the version php you use - till php 7.3 you can use something like that:

setcookie('PHPSESSID', $_REQUEST['id'], time() + 60 * 60 * 24 * 1, '/; samesite=None; Secure;');

Since php 7.3 you can use set_cookie_params() function;

A short summary of the article is that the problem is caused by Session of a user set without the flag "samesite=none; Secure;". This is happening since the Chrome version 80. Be aware that by fixing the issue for Chrome 80, you may break your application for apple users... So you need to add a check for the user agent/browser. You will find more info in the article above...