Repository navigation
Honor oversized cookie deletions and keep a replaced cookie's place - #113
Merged
Merged
Conversation
A Set-Cookie with Max-Age=0 was checked against the per-cookie size limit before the deletion was handled, so a site that logs out by sending the full session value back left the old cookie in the store. Deletions are now handled first. Replacing a cookie removed the old one and pushed the new one to the end, which lost its creation-time order (RFC 6265 5.3 step 11.3) and could put a stale same-name cookie first in the Cookie header. The replacement now takes the old cookie's slot. Fixes #91 Fixes #92
en0f
approved these changes
Oct 5, 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.
Fixes #91 and #92, both in
ChainCookies::store.Max-Age=0or a pastExpires) is now handled before the per-cookie size check. Before this, a site that logs out by sending the full session value back withMax-Age=0had the deletion refused, and the old session cookie kept going out. A site still can't delete a cookie the caller set.Cookieheader sort relies on, so when one name is held at two scopes, the one the site just reissued stays first.Three new unit tests cover the logout case, a simple reset, and the two-scope case.