Skip to content

Fix cookiestore defaults propagation#42418

Merged
TimvdLippe merged 1 commit intoservo:mainfrom
sebsebmc:cookiestore-set-defaults
Feb 7, 2026
Merged

Fix cookiestore defaults propagation#42418
TimvdLippe merged 1 commit intoservo:mainfrom
sebsebmc:cookiestore-set-defaults

Conversation

@sebsebmc
Copy link
Copy Markdown
Contributor

@sebsebmc sebsebmc commented Feb 6, 2026

Also fixes propagating expiry clamping to underlying cookie object. This matters when attempting to inspect expiry time from a retrieved cookie.
According to the WPT tests, setting max-age in a cookie string is supposed to be visible in the retrieved expiry.

Testing: cookiestore WPT tests cover this behavior

… underlying object

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
@sebsebmc sebsebmc requested a review from gterzian as a code owner February 6, 2026 22:47
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Feb 6, 2026
@@ -1,6 +1,7 @@
[change_eventhandler_for_already_expired.https.window.html]
expected: TIMEOUT
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

usually FAIL better then TIMEOUT, do we knew why?

Copy link
Copy Markdown
Contributor Author

@sebsebmc sebsebmc Feb 7, 2026

Choose a reason for hiding this comment

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

Im not sure why they were failing before, but we currently don't implement the cookie change event so this should be timing out since we will never fire the event.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think before we weren't actually setting the expiry, and so the cookie was not getting deleted, which was a FAIL. Now the cookie is deleted but we don't fire the event.

}
if let Some(expiry) = options.expires {
cookie.inner_mut().set_expires(
OffsetDateTime::from_unix_timestamp((*expiry / 1000.0) as i64).unwrap(),
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Im not thrilled about this personally, just not sure how to best clean it up.

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Feb 7, 2026
@TimvdLippe TimvdLippe added this pull request to the merge queue Feb 7, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Feb 7, 2026
Merged via the queue into servo:main with commit 639fccd Feb 7, 2026
33 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Feb 7, 2026
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.

4 participants