Same issue occurs in ASP.NET as in ASP.NET Core.
Until Microsoft produce a fix, a hack that's working for me is to replace
myCookie.Path = "/";
myCookie.SameSite = SameSiteMode.None; // has no effect
with
myCookie.Path = "/; SameSite=None";
This adds SameSite=None
to the set-cookie
header in the HTTP response.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…