-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feat]: Remember password across browser session restarts #5437
Comments
Thinking out loud here...I believe the cookie is set here after you enter a valid password: code-server/src/node/routes/login.ts Line 87 in ec3d997
And this is where the logic for the cookie options are set: Lines 259 to 286 in ec3d997
I also believe we use a session cookie instead of a permanent cookie which explains why it expires between browser sessions: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#define_the_lifetime_of_a_cookie @code-asher is this accurate? Is there anything we can do to improve this? |
I think you are right. Session cookies sound like what we want since their expiration appears to be controlled by the browser? My cookie persists after restarting my browser (Firefox). I have "restore previous session" checked which might be why. |
I think session cookies is where my problem was, since they didn't last any longer than a browser session, which seems to be reboots in my case. Would there be any reason to not support anything longer, even if a checkbox saying something like "Remember me" had to be clicked? |
Workaround: select "Continue where you left off" in Chrome? See here |
That appears to be working - it's good enough for the time being, though my last Chrome tab always reopening after closing the browser is a bit annoying (it happens if I click the X in the top right of Chrome, closing each tab alleviates that but I'm doubting my brain's gonna remember to do that every time). |
I think the "remember me" checkbox requires us to set an expiration which means we would not be able to use session cookies. Basically we can either let the user decide the session length or we can decide for them and currently we do the former. But it does seem odd that browsers do not give you the option to remember session cookies but not re-open every tab. 🤔 We could change the login form to give the user the option of what kind of cookie to use. |
What is your suggestion?
I have a fairly complicated password on my code-server instance, and every time I restart my device (a Chrome OS laptop from my school) I have to log back in to my instance. It would be nice if code-server always remembered my password, or at least a period longer than across computer reboots.
Why do you want this feature?
So I don't have to keep typing in my long password.
Are there any workarounds to get this functionality today?
No
Are you interested in submitting a PR for this?
Not likely as I don't do much work with JavaScript, though I'd be open to it if it isn't overly complicated.
The text was updated successfully, but these errors were encountered: