Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: f9cc88e07ed1bb57fa94be970f04495ff1e536c1
      
https://github.com/WebKit/WebKit/commit/f9cc88e07ed1bb57fa94be970f04495ff1e536c1
  Author: Rupin Mittal <[email protected]>
  Date:   2026-03-23 (Mon, 23 Mar 2026)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/cookiestore/cookieStore_set_maxAge.https.window-expected.txt
    A 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/cookiestore/cookieStore_set_maxAge.https.window-expected.txt
    M Source/WebCore/Modules/cookie-store/CookieInit.h
    M Source/WebCore/Modules/cookie-store/CookieInit.idl
    M Source/WebCore/Modules/cookie-store/CookieStore.cpp

  Log Message:
  -----------
  [Cookie Store API] Add support for setting maxAge
https://bugs.webkit.org/show_bug.cgi?id=303549
rdar://166301541

Reviewed by Anne van Kesteren.

The Cookie Store API already supports the expires attribute. This is an absolute
timestamp in milliseconds since epoch: "Cookie expires at 3:00 PM on March 25, 
2026."

Recently, the Cookie Store API spec was updated to add a maxAge attribute in
https://github.com/whatwg/cookiestore/pull/292.

This patch adds support for this new maxAge attribute. This is a relative 
duration
in seconds: "Cookie expires 60 seconds from now."

When setting a cookie, you can only specify one of the two. Since the 
WebCore::Cookie
has only expiry-related property (WebCore::Cookie::expires), both of these 
Cookie
Store API attributes will use that.

We also update the code to use Seconds so it's more clear which units are being 
used.

* 
LayoutTests/imported/w3c/web-platform-tests/cookiestore/cookieStore_set_maxAge.https.window-expected.txt:
* 
LayoutTests/platform/glib/imported/w3c/web-platform-tests/cookiestore/cookieStore_set_maxAge.https.window-expected.txt:
 Added.
* Source/WebCore/Modules/cookie-store/CookieInit.h:
(WebCore::CookieInit::isolatedCopy const):
(WebCore::CookieInit::isolatedCopy):
* Source/WebCore/Modules/cookie-store/CookieInit.idl:
* Source/WebCore/Modules/cookie-store/CookieStore.cpp:
(WebCore::CookieStore::set):

Canonical link: https://commits.webkit.org/309738@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to