On deleting a cookie firefox is complaining about the samesite and secure cookie fields not being set
Categories
(Core :: Networking: Cookies, defect)
Tracking
()
People
(Reporter: f.ostkamp, Unassigned)
Details
Attachments
(1 file)
|
191 bytes,
text/html
|
Details |
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0
Steps to reproduce:
Save a new cookie with with samesite and secure set:
document.cookie = "CookieTest=This just tests if cookies can be set; url=/; samesite=lax; secure";
Delete cookie with:
document.cookie = "CookieTest=; expires=Thu, 01 Jan 1970 00:00:00 UTC;";
Actual results:
The cookie deletion causes Firefox show the "Cookie “CookieTest” will be soon rejected because it has the “sameSite” attribute set to “none” or an invalid value, without the “secure” attribute. To know more about the “sameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite" warning in the console.
Expected results:
As there is no cookie set that is missing the samesite and secure attributes, Firefox shouldn't display a warning.
Comment 1•6 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Comment 2•6 years ago
|
||
(In reply to f.ostkamp from comment #0)
Save a new cookie with with samesite and secure set:
document.cookie = "CookieTest=This just tests if cookies can be set; url=/; samesite=lax; secure";Delete cookie with:
document.cookie = "CookieTest=; expires=Thu, 01 Jan 1970 00:00:00 UTC;";
This deletes the cookie by updating its expiration time to the past. To avoid the error message use samesite attribute here as well:
document.cookie = "CookieTest=; expires=Thu, 01 Jan 1970 00:00:00 UTC; samesite=lax; secure";
Description
•