fix: delete v3 appSession cookie on logout#2552
Merged
Piyush-85 merged 2 commits intoauth0:mainfrom Apr 28, 2026
Merged
Conversation
When upgrading from v3 to v4, the legacy appSession cookie was only cleaned up during login (set), not during logout (delete). This caused users with a lingering v3 cookie to bypass authentication on their next login attempt. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
@gmurphey Thanks for the contribution. This fix was critical and LGTM. Note - Will add a section Session Cookie Migration in the |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2552 +/- ##
==========================================
+ Coverage 89.83% 89.85% +0.01%
==========================================
Files 67 67
Lines 8119 8135 +16
Branches 1739 1743 +4
==========================================
+ Hits 7294 7310 +16
Misses 813 813
Partials 12 12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Piyush-85
approved these changes
Apr 28, 2026
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.
Summary
appSessioncookie was only cleaned up during login (set()), not during logout (delete()). This caused users with a lingering v3 cookie to bypass authentication on their next login attempt.appSessioncookie deletion toStatelessSessionStore.delete()andStatefulSessionStore.delete(), mirroring the existing cleanup logic in theirset()methods.Test plan
delete()removes legacy chunkedappSessioncookie when presentdelete()removes legacyappSessioncookie when presentdelete()skips redundant deletion when session cookie name is alreadyappSession🤖 Generated with Claude Code