Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: d5be61fee14a830023a971b2621e47051a9e78ef
https://github.com/WebKit/WebKit/commit/d5be61fee14a830023a971b2621e47051a9e78ef
Author: Alejandro G. Castro <[email protected]>
Date: 2026-09-11 (Fri, 11 Sep 2026)
Changed paths:
M Source/WebDriver/Session.cpp
M WebDriverTests/TestExpectations.json
Log Message:
-----------
[WebDriver] Add Cookie drops the cookie when the request has no sameSite
attribute
https://bugs.webkit.org/show_bug.cgi?id=323634
Reviewed by Carlos Garcia Campos.
The sameSite field is optional in the Add Cookie command, but the sameSite
member of the Automation protocol Cookie type is mandatory, so the driver has
to fill it in when the client omits it, and it filled it in with None. That
is not the same thing as having no SameSite attribute: a cookie with
SameSite=None is only accepted when it is also Secure, and libsoup enforces
that when the cookie is added to the jar, whatever the origin is. The jar
quietly discards the cookie, the command still answers success, and the
cookie is then in neither the page nor the network session.
A cookie set by a page without a SameSite attribute behaves as Lax, which is
also libsoup's own default for a cookie parsed without the attribute, so use
Lax as the default here too instead of None.
This is what bug 279079 was tracking: 70 of its subtests pass now, in
add_cookie, in the user prompt tests of add_cookie, delete_cookie,
delete_all_cookies and get_named_cookie, which all add a cookie before
checking the prompt, and in the imported selenium cookie tests. The remaining
expectation of that bug,
add_cookie/add.py::test_add_cookie_with_valid_samesite_flag[None], passes
without this change as well and is removed as an outdated expectation.
* Source/WebDriver/Session.cpp:
(WebDriver::builtAutomationCookie):
* WebDriverTests/TestExpectations.json:
Canonical link: https://commits.webkit.org/320916@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications