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
{{ message }}
Repository navigation
Allow configuring login cookie with an expiry duration #7301
Allow configuring an (optional) expiry age for the login cookie so that it persists beyond a browser session. This is handy for not re-entering the password every time.
...
return{domain: getCookieDomain(url.host,req.args["proxy-domain"]),path: normalize(url.pathname)||"/",sameSite: "lax",// Load, if provided, max age for login cookie. 0 means it becomes a Session cookie (according to Express docs)maxAge: getConfigCookieMaxAgeAsMilliseconds()||0,}
Why do you want this feature?
I want to maintain my login status even after closing the browser (as the Cookie is currently session-only). Say keep the login cookie for a week or a month. Adding a max-age changes the cookie from Session to persistent for the given duration using Express' maxAge parameter (docs).
Are there any workarounds to get this functionality today?
No, none directly. User can manually edit the cookie in Devtools
Are you interested in submitting a PR for this?
I'm not that familiar with how to make new configuration argument and also how the config args are read (there's some middleware for args IIRC, but not sure how to use that). But I can give it a go, with some help.
The above given change should be roughly all that's needed, sans the config reading.
Proposal: an opt-in --cookie-max-age <seconds> flag (also available in config.yaml) that sets Max-Age on the login cookie. Without it nothing changes and it stays a session cookie. It is applied only when the cookie is set at login, because logout reuses the cookie options to clear it, and non-positive values are rejected at startup.
@code-asher, does that name and shape work for you? I already have a branch with tests ready and will open the PR once you're happy with the approach.
Activity
harshbhx commentedon Nov 17, 2026
Hi, I'd like to take this one.
Proposal: an opt-in
--cookie-max-age <seconds>flag (also available in config.yaml) that sets Max-Age on the login cookie. Without it nothing changes and it stays a session cookie. It is applied only when the cookie is set at login, because logout reuses the cookie options to clear it, and non-positive values are rejected at startup.@code-asher, does that name and shape work for you? I already have a branch with tests ready and will open the PR once you're happy with the approach.