Skip to content

Cookies: add tests for expiry at read, path length order, repeated attributes and other methods - #64550

Open
rifmj wants to merge 1 commit into
web-platform-tests:masterfrom
rifmj:cookies-expiry-order-attributes
Open

rifmj wants to merge 1 commit into
web-platform-tests:masterfrom
rifmj:cookies-expiry-order-attributes

Conversation

@rifmj

@rifmj rifmj commented Nov 2, 2026 •

Copy link
Copy Markdown

New tests in cookies/. I found no existing coverage for these cases:

  • samesite/methods-beyond-get-post.html: PUT, DELETE, PATCH and OPTIONS carry a SameSite=Strict cookie on a same-origin request.
  • ordering/equal-segment-count.html: two paths with the same number of segments sort by length, not by creation time. ordering.sub.html covers paths with different segment counts only.
  • attributes/expired-at-read.html: an expired cookie is gone with no Set-Cookie in between, checked separately for the Cookie header and document.cookie, with a control cookie. Each check waits 4 seconds, so the file has timeout=long.
  • attributes/last-attribute.html: Max-Age before Expires in both directions, a last Path without a leading /, and an empty Domain.
  • attributes/last-attribute.tentative.html: a last unparsable Expires and Domain=.. Browsers differ here from RFC 6265bis 5.6.1 step 2 and 5.6.3, so these two are tentative.

Results under ./wpt serve with Playwright 1.64.1 builds, three identical runs. I did not run ./wpt run.

Test Chromium 156 Firefox 157 WebKit 27.2
methods-beyond-get-post 4/4 4/4 4/4
equal-segment-count 1/1 1/1 1/1
expired-at-read 2/2 2/2 2/2
last-attribute 4/4 4/4 3/4
last-attribute.tentative 2/2 2/2 2/2

The WebKit failure is the Path=foo case: the cookie API reports the literal path foo, and the cookie does not come back on the default path. I have not checked Safari.

Related: whatwg/fetch#1965, whatwg/fetch#1826, httpwg/http-extensions#3581, httpwg/http-extensions#3582, httpwg/http-extensions#3583.

Drafted with AI help.

…tributes and other methods

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants