The trick with
cookie.Path = strCookiePath + "; SameSite=None";
doesn't work anymore (Fx 4.5.2). I searched the whole day for a solution, because we can't upgrade the Fx-Version for the site in question.
We found the following solution for the situation, where the cookie exists in the request:
using System.Reflection;
...
HttpCookie cookie = HttpContext.Current.Request.Cookies[key];
cookie.Secure = false; // Set whatever properties you need
PropertyInfo pti = cookie.GetType().GetProperty("SameSite");
if ( null != pti )
{
pti.SetValue( cookie, -1 ); // -1 => Lax, 0 => None
}
HttpContext.Current.Response.Cookies.Add( cookie );
I hope it might be useful for somebody. The point here is, that the cookie was set with FormsAuthentication.SetAuthCookie, which doesn't set a value for SameSite. The browser turns the missing property into the "Lax" value. If you want to reset the cookie, the default value read from the request is "None". If you send the cookie without changing the SameSite-Property, the browser won't update the cookie, because the SameSite-Property of the new cookie (None) is not the same as the original (Lax).
Therefore you must change the value somehow. But since the browser sends the property to the server, the property exists and can be changed using reflection.