Reputation: 96986
I am using Firefox 3.6.10 (OS X Intel), and the browser collects new cookies, instead of expiring ("deleting") the old cookies.
These cookies are created and added via Perl's CGI
and CGI::Cookie
modules.
I am creating and adding a cookie as follows:
my $myNewCookie = new CGI::Cookie(-name => "$myCookieName",
-value => { 'key1' => $value1, 'key2' => $value2 },
-expires => '+8h',
-secure => 1
);
print redirect(-URL => "$hostURL$redirect",
-cookie => $myNewCookie);
Here is how I am trying to make them expire:
sub clearCookie {
my $myOldCookie = cookie(-name => "$myCookieName",
-value => '',
-expires => '-1d',
-secure => 1);
print header(-cookie=>$myOldCookie);
# ...
}
Here is what happens:
I can keep going and Firefox will just accumulate more cookies without expiring any of them.
My scripts work under current versions of Google Chrome and Apple Safari, but Firefox seems uncooperative.
Is there a setting I am missing, which will correctly tell Firefox to adjust the expiration date of my cookie?
Thanks for your advice.
Upvotes: 3
Views: 1654
Reputation: 96986
It looks like this is a known and frustrating bug with Firefox.
Upvotes: 5