Closed Bug 1654847 Opened 6 years ago Closed 6 years ago

On deleting a cookie firefox is complaining about the samesite and secure cookie fields not being set

Categories

(Core :: Networking: Cookies, defect)

78 Branch
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: f.ostkamp, Unassigned)

Details

Attachments

(1 file)

Attached file cookie.html —

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.

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

Component: Untriaged → Networking: Cookies
Product: Firefox → Core

(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";

Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: