Skip to content

layered-cookies: sort Retrieve Cookies by path length, not segment count - #3583

Open
rifmj wants to merge 1 commit into
httpwg:mainfrom
rifmj:layered-sort-path-length
Open

rifmj wants to merge 1 commit into
httpwg:mainfrom
rifmj:layered-sort-path-length

Conversation

@rifmj

@rifmj rifmj commented Nov 2, 2026

Copy link
Copy Markdown

Retrieve Cookies sorts by "path's size", the number of segments. RFC 6265, RFC 6265bis 5.8.3, browsers and WPT all use length. The results differ in two ways.

  • A URL path / is [""] and /foo is ["foo"], both of size 1. With a=1; Path=/, then b=2; Path=/foo, a request to /foo/bar gives a=1; b=2 by the steps. Chromium 156, Firefox 157 and WebKit 27.2 give b=2; a=1. cookies/ordering/ordering.sub.html "(2)" already expects this (testH on /cookies before testC on /, though created later).
  • /a/ and /a/b are both of size 2. The steps fall back to creation order; all three put /a/b first. I found no test for equal segment counts, so Cookies: add tests for expiry at read, path length order, repeated attributes and other methods web-platform-tests/wpt#64550 adds cookies/ordering/equal-segment-count.html (1/1 in all three).

Drafted with AI help.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant