Repository navigation
Conversation
A session ends SESSION_COOKIE_AGE (14 days) after it was last saved, which is usually when the user signed in. Someone who uses Sentry every day still has to sign in again every two weeks. Save the session again when a signed-in user makes a request for an organization with organizations:sliding-session-expiry and the session is more than a day old. The 14 days then limit inactivity instead. Requests authenticated with a token, failed requests and responses that may be cached never renew a session. Refs #43182 Refs ENG-6427 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A login session ends
SESSION_COOKIE_AGE(14 days) after it was last saved, which is usually when the user signed in. Someone who uses Sentry every day still has to sign in again every two weeks.With
organizations:sliding-session-expiry, a signed-in user's session is saved again when they make a request for that organization and the session is more than a day old. The 14 days then limit inactivity instead of counting from sign-in. Without the flag nothing changes.Review notes
AuthenticationMiddleware.process_response. It only acts when the session cookie signed the user in (get_usercached a user), so token requests never get a session, and it doesn't read the session on requests that hadn't already._renewed_at, so the cookie is set again at most once per interval: a day, or half ofSESSION_COOKIE_AGEwhen that is shorter.Refs #43182
Refs ENG-6427
🤖 Generated with Claude Code