Skip to content
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

Tell browser to delete invalid session tokens #50

Merged
merged 1 commit into from
Jan 12, 2025

Conversation

mtlynch
Copy link
Contributor

@mtlynch mtlynch commented Jan 11, 2025

Currently, if the user logs in to the server with the correct password, they get a cookie called session-token. If the server's password changes, the server (correctly) responds with an HTTP 401 Unauthorized when the user tries to use the token associated with the old password.

The problem is that the server's HTTP 401 response doesn't tell the client's browser to delete the old session token cookie, so it keeps sending it on every request even though the server knows it's bad.

Currently, it doesn't cause any noticeable problems, but I'm working on a change that will affect the data that we store in the session token, so it can lock the user out even if they have the same password because the password will be correct but they'll be using a session token that's invalid.

Currently, if the user logs in to the server with the correct password, they get a cookie called session-token. If the server's password changes, the server (correctly) responds with an HTTP 401 Unauthorized when the user tries to use the token associated with the old password.

The problem is that the server's HTTP 401 response doesn't tell the client's browser to delete the old session token cookie, so it keeps sending it on every request even though the server knows it's bad.

Currently, it doesn't cause any noticeable problems, but I'm working on a change that will affect the data that we store in the session token, so it can lock the user out even if they have the same password because the password will be correct but they'll be using a session token that's invalid.
@0x2E
Copy link
Owner

0x2E commented Jan 12, 2025

Thanks!

@0x2E 0x2E merged commit 6cc04c0 into 0x2E:main Jan 12, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants