Closed Bug 1676651 Opened 4 years ago Closed 1 year ago

Console warnings "Cookie has been rejected because it is already expired."

Categories

(Core :: Networking: Cookies, defect, P3)

Firefox 82
defect

Tracking

()

RESOLVED FIXED
114 Branch
Tracking Status
firefox-esr102 --- wontfix
firefox112 --- wontfix
firefox113 --- wontfix
firefox114 --- fixed

People

(Reporter: iztok.kavkler, Assigned: longsonr)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression, Whiteboard: [necko-triaged])

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:82.0) Gecko/20100101 Firefox/82.0

Steps to reproduce:

Used standard XSRF token in Spring-Angular application. It deletes cookie XSRF-TOKEN and then re-creates it on every request.

Actual results:

The cookie was deleted and recreated, but for every request there was a warning "Cookie “XSRF-TOKEN” has been rejected because it is already expired." in the console.

Expected results:

There should be no warning since setting expiration time in the past is the standard way to delete cookies.

Regressed by: 1596741
Has Regression Range: --- → yes

Setting a component for this issue in order to get the dev team involved.
If you feel it's an incorrect one please feel free to change it to a more appropriate one.

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

baku, can you take a look?

Severity: -- → S4
Flags: needinfo?(amarchesini)
Priority: -- → P3
Whiteboard: [necko-triaged]

This behavior occurs when passing a cookie value of null,false, or empty string.

Steps To Reproduce.
<?php
setcookie("test1", "");
?>

Looks like the logging code added here can simply be removed. If the HTTP spec says that expired cookies shall be deleted and no other browser informs about this normal operation, then why does Firefox pollute the console log here, and then even as a warning? I mean, the message is useless and not applicable when the intention was to delete a cookie. In other words, it's wrong, which is a bug worth fixing. And this one is really trivial.

(Please don't ask me to provide a patch. I already tried to set up a Firefox build environment and failed after many hours. I won't do that again for a 1-minute fix. Lots of people already have the required tools.)

Blocks: cookie
Assignee: nobody → longsonr
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by longsonr@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/f6e3407883b4
don't warn to console if a cookie is deleted r=dveditz
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 114 Branch
Flags: needinfo?(amarchesini)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: