cookieStore.delete() doesn't respect given domain
Categories
(Core :: Networking: Cookies, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox158 | --- | fixed |
People
(Reporter: bugzilla.memmie, Assigned: baku)
References
Details
Attachments
(1 external file)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:156.0) Gecko/20100101 Firefox/156.0
Steps to reproduce:
- go on https://www.example.com/
- execute the following code :
await cookieStore.set({name: "a", value: "example.com", domain: "example.com"});
await cookieStore.set({name: "a", value: "www.example.com", domain: "www.example.com"});
await cookieStore.set({name: "a", value: "null", domain: null});
for(let i = 3; i-- > 0;) await cookieStore.delete({name: "a", domain: "www.example.com"});// twice
const actual = (await cookieStore.getAll()).map(c => `${c.name}=${c.value}`).join("; ");
const expected = "a=example.com; a=null";
console.assert(actual === expected, actual, expected);
Actual results:
Got an assertion fail exception:
Assertion failed: <empty string> a=example.com; a=null
All cookies are deleted.
It look likes the domain is ignored, and it is already known.
Expected results:
No assertion fail. Only subdomain cookie should be deleted.
We should be able to delete cookie on subdomain, but not all cookies availables.
That what we can do with document.cookie API:
document.cookie = `a=example.com; Secure; Domain=example.com`;
document.cookie = `a=www.example.com; Secure; Domain=www.example.com`;
document.cookie = `a=null; Secure`;
for(let i = 3; i-- > 0;) document.cookie = `a=; Secure; Expires=Thu, 01 Jan 1970 00:00:00 GMT; Domain=www.example.com`;
const actual = document.cookie;
const expected = "a=example.com; a=null";
console.assert(actual === expected, actual, expected);
Comment 1•2 months ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Networking: Cookies' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
| Assignee | ||
Comment 2•2 months ago
|
||
Updated•2 months ago
|
Comment 4•2 months ago
|
||
Backed out for causing wpt failures
Backout Link
Push with failures
Failure Log
Failure line TEST-UNEXPECTED-FAIL | /cookiestore/httponly_cookies.https.window.html | HttpOnly cookies are not observed - assert_equals: HttpOnly cookie we wrote using HTTP in cookie jar is invisible to script expected (undefined) undefined but got (string) "uppercase=cookie-value"
Updated•2 months ago
|
| Assignee | ||
Updated•2 months ago
|
Comment 6•2 months ago
|
||
| bugherder | ||
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/62602 for changes under testing/web-platform/tests
Upstream PR merged by moz-wptsync-bot
Comment 9•2 months ago
|
||
:baku did you want to nominate this for 158 release notes?
Updated•2 months ago
|
Updated•1 month ago
|
Updated•1 month ago
|
Description
•