Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 38021f3656b229039212e174f4a44d997c3a9c06
      
https://github.com/WebKit/WebKit/commit/38021f3656b229039212e174f4a44d997c3a9c06
  Author: Matthew Finkel <[email protected]>
  Date:   2025-10-03 (Fri, 03 Oct 2025)

  Changed paths:
    M Source/WebKit/Configurations/AllowedSPI.toml
    M Source/WebKit/UIProcess/API/APIHTTPCookieStore.cpp
    M Source/WebKit/UIProcess/API/APIHTTPCookieStore.h
    M Source/WebKit/UIProcess/API/Cocoa/WKHTTPCookieStore.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm

  Log Message:
  -----------
  Strip StoragePartition from cookies returned by WKHTTPCookieStore API
rdar://147233516
https://bugs.webkit.org/show_bug.cgi?id=292351

Reviewed by Alex Christensen.

The WKHTTPCookieStore API returns a NSHTTPCookie. When opt-in partitioned
cookies is enabled, a partitioned cookie can be set in either of a first or
third party context. As such, when a first party cookie is "partitioned", its
NSHTTPCookie will contain the "StoragePartition" property.  This is internal
state that does not need to be exposed to an application that uses the
WKHTTPCookieStore API, and it can cause breakage in some situations.

This change clears the cookie property before the cookie is returned to the
application when the WKHTTPCookieStore API is used.

Adds a new API test.

Test: Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm

Test: Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm
* Source/WebKit/Configurations/AllowedSPI.toml:
* Source/WebKit/UIProcess/API/APIHTTPCookieStore.cpp:
(API::HTTPCookieStore::isOptInCookiePartitioningEnabled const):
* Source/WebKit/UIProcess/API/APIHTTPCookieStore.h:
* Source/WebKit/UIProcess/API/Cocoa/WKHTTPCookieStore.mm:
(clearCookiePartitionPropertyIfNeeded):
(-[WKHTTPCookieStore getAllCookies:]):
(-[WKHTTPCookieStore _getCookiesForURL:completionHandler:]):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm:
(TEST(WKHTTPCookieStore, PartitionedCookieShouldNotHavePartitionProperty)):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to