Skip to content

Conversation

@aamuley
Copy link
Collaborator

@aamuley aamuley commented Nov 13, 2025

Add maxAge as a CookieInitOption used in cookieStore.set(options).
Related to #57 #162

(See WHATWG Working Mode: Changes for more details.)


Preview | Diff

@aamuley aamuley requested review from DCtheTall and annevk November 17, 2025 13:56
@aamuley aamuley marked this pull request as ready for review November 17, 2025 13:57
Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For other fields we have some validation. Do we want to throw if both expires and maxAge are passed?

@aamuley
Copy link
Collaborator Author

aamuley commented Nov 18, 2025

hmm i was planning to let that decision fall to the rfc and just prefer the maxAge if both are specified since that might be more expected behavior for devs, wdyt @DCtheTall?

@annevk
Copy link
Member

annevk commented Nov 19, 2025

Once we start targeting the layered-cookies I-D instead of the current RFC, I'm pretty sure we'll need to resolve the duplication locally anyway as we're not going to serialize what we have and feed it into the parser, but instead we'll create a cookie instance here and use that.

@aamuley
Copy link
Collaborator Author

aamuley commented Nov 19, 2025

Oh I didnt realize that, happy to check which is specified and throw an error in that case. Would you rather we construct a unified expiry time (between max-age and expires) in this algorithm right now, or leave that for when the RFC is being updated?

@annevk
Copy link
Member

annevk commented Nov 20, 2025

I think we should leave that until we update this specification to target the layered-cookies I-D.

@bakulf thoughts on all this?

Copy link
Member

@DCtheTall DCtheTall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one suggestion

@aamuley aamuley requested review from DCtheTall and annevk November 21, 2025 15:20
@aamuley
Copy link
Collaborator Author

aamuley commented Dec 3, 2025

fyi, updated the initial PR description now the wpts merged web-platform-tests/wpt@0f2fc46. also @annevk mind if I list WebKit as an interested implementer, or would you rather I follow up on the original Cookie Store API stds position request?

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can list WebKit as interested. We also need a WPT PR to rename the tests away from tentative.

@aamuley aamuley requested a review from annevk December 4, 2025 15:51
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Dec 4, 2025
whatwg/cookiestore#292 (review)

Bug: 430926231
Change-Id: I1a25d37d7b150fd08d304f1c3734b2fd842d49cf
aarongable pushed a commit to chromium/chromium that referenced this pull request Dec 4, 2025
whatwg/cookiestore#292 (review)

Bug: 430926231
Change-Id: I1a25d37d7b150fd08d304f1c3734b2fd842d49cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7227980
Reviewed-by: Aaron Selya <[email protected]>
Commit-Queue: Anusha Muley <[email protected]>
Reviewed-by: Dylan Cutler <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1554072}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Dec 4, 2025
whatwg/cookiestore#292 (review)

Bug: 430926231
Change-Id: I1a25d37d7b150fd08d304f1c3734b2fd842d49cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7227980
Reviewed-by: Aaron Selya <[email protected]>
Commit-Queue: Anusha Muley <[email protected]>
Reviewed-by: Dylan Cutler <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1554072}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Dec 4, 2025
whatwg/cookiestore#292 (review)

Bug: 430926231
Change-Id: I1a25d37d7b150fd08d304f1c3734b2fd842d49cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7227980
Reviewed-by: Aaron Selya <[email protected]>
Commit-Queue: Anusha Muley <[email protected]>
Reviewed-by: Dylan Cutler <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1554072}
@annevk annevk merged commit f028e8b into whatwg:main Dec 8, 2025
2 checks passed
lando-prod-mozilla bot pushed a commit to mozilla-firefox/firefox that referenced this pull request Dec 11, 2025
…n-tentative, a=testonly

Automatic update from web-platform-tests
Mark Cookie Store API `max-age` tests non-tentative

whatwg/cookiestore#292 (review)

Bug: 430926231
Change-Id: I1a25d37d7b150fd08d304f1c3734b2fd842d49cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7227980
Reviewed-by: Aaron Selya <[email protected]>
Commit-Queue: Anusha Muley <[email protected]>
Reviewed-by: Dylan Cutler <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1554072}

--

wpt-commits: 10c64cd2ef2b28c5637cc6dd3d24f11b6969c883
wpt-pr: 56489
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this pull request Dec 15, 2025
…n-tentative, a=testonly

Automatic update from web-platform-tests
Mark Cookie Store API `max-age` tests non-tentative

whatwg/cookiestore#292 (review)

Bug: 430926231
Change-Id: I1a25d37d7b150fd08d304f1c3734b2fd842d49cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7227980
Reviewed-by: Aaron Selya <[email protected]>
Commit-Queue: Anusha Muley <[email protected]>
Reviewed-by: Dylan Cutler <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1554072}

--

wpt-commits: 10c64cd2ef2b28c5637cc6dd3d24f11b6969c883
wpt-pr: 56489
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.

3 participants