Chrome is changing the default value of SameSite
cookie attribute from None
to Lax
as of its version 80. My site is embedded to another site using an iframe and the login session of my site is handled by express-session
.
For new browsers the solution is just to set the session cookie to SameSite=None; Secure
which express-session
already supports. However, some clients are incompatible for the SameSite
attribute and would stop working.
One proposed solution to the problem is to use two cookies, one for new clients and one for the old incompatible clients:
Set-cookie: session-id=value; SameSite=None; Secure
Set-cookie: session-id-legacy=value; Secure
Is it possible to use the proposed two-cookie solution to the problem or is there a better way in express-session
to also provide support to old incompatible browsers?