Skip to content

Honor oversized cookie deletions and keep a replaced cookie's place - #113

Merged
liquidsec merged 1 commit into
devfrom
fix-cookie-store
Oct 5, 2026
Merged

liquidsec merged 1 commit into
devfrom
fix-cookie-store

Conversation

@liquidsec

Copy link
Copy Markdown
Contributor

Fixes #91 and #92, both in ChainCookies::store.

Three new unit tests cover the logout case, a simple reset, and the two-scope case.

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
@liquidsec
liquidsec requested a review from singlerider October 5, 2026 15:17
@liquidsec
liquidsec merged commit e752fa4 into dev Oct 5, 2026
15 checks passed
@liquidsec
liquidsec deleted the fix-cookie-store branch October 5, 2026 20:29
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.

3 participants