You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The problem with the sessionDuration setting is that it looks at the session record in the database only and decides to kill the session based on the last access time. However, the session and session.sig cookies don't have a maxAge setting so they expire when the browser session expires, which is unpredictable. On desktops, it's usually when you close the browser, but on mobile it's whenever the OS decides (mostly). This leads to random logouts for users.
A simple way to fix this is to allow the maxAge setting in cookieOptions which will be passed to the cookie expressed middleware.
The text was updated successfully, but these errors were encountered:
I'll add maxAge to the interface. For now, you should still actually be able to add it (although you'll need to make TypeScript happy) as the entire object gets passed as-is to the cookieSession middleware.
Note that currently, we do set maxAge when logging in with the rememberMe: true input set:
Is your feature request related to a problem? Please describe.
The problem with the
sessionDuration
setting is that it looks at the session record in the database only and decides to kill the session based on the last access time. However, thesession
andsession.sig
cookies don't have a maxAge setting so they expire when the browser session expires, which is unpredictable. On desktops, it's usually when you close the browser, but on mobile it's whenever the OS decides (mostly). This leads to random logouts for users.A simple way to fix this is to allow the
maxAge
setting incookieOptions
which will be passed to the cookie expressed middleware.The text was updated successfully, but these errors were encountered: