Closed Bug 201662 Opened 21 years ago Closed 21 years ago

Cookie deletion by setting expiry date in the past no longer works

Categories

(Core :: Networking: Cookies, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 200429

People

(Reporter: principalino, Assigned: darin.moz)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4a) Gecko/20030401
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4a) Gecko/20030401

A cookie that was set without explicit expiry time specification cannot be
deleted by setting it to a null value with an expiry time in the past.


Reproducible: Always

Steps to Reproduce:
1. Set a cookie with no explicit expiry specification; in PHP you can do this with
   setcookie("foo","bar",0,'/','.your.domain');
The cookie is stored correctly (according to the "Stored cookie" tool).

2. Try to delete the cookie by setting an expiry date in the past (e.g. 12 Apr
2002):
   setcookie("foo","",mktime(0,0,0,4,12,2002),'/','.your.domain');
Actual Results:  
The cookie was not deleted nor was it changed in any way.

Expected Results:  
The cookie should have been deleted.

Not sure if the described behaviour should be considered a bug or a feature.

If an explicit expiry time (in the future) is specified when setting the cookie
in step 1., the "bug" does not occur - the cookie is properly deleted in step 2.

This "bug" seems to affect only Mozilla 1.4a, not any previous release.
This sounds like a bug that was fixed just after 1.4a. Could you try a recent
nightly to check? Thanks.

*** This bug has been marked as a duplicate of 200429 ***
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.