2

The time the cookie expires. This is a Unix timestamp so is in number of seconds since the epoch. In other words, you'll most likely set this with the time() function plus the number of seconds before you want it to expire. Or you might use mktime(). time()+60*60*24*30 will set the cookie to expire in 30 days. If set to 0, or omitted, the cookie will expire at the end of the session (when the browser closes).

Taken from:- http://www.php.net/manual/en/function.setcookie.php

Can anyone explain why is FireFox not deleting cookies with an unspecified expiry time on exit?

I've tested in Chrome, Opera and IE they all delete those cookies at exit.

Is this a Firefox bug?

Samuel Katz
  • 24,066
  • 8
  • 71
  • 57

4 Answers4

5

Are you saving your tabs session when exiting Firefox? See this post for more.

Community
  • 1
  • 1
1

have you tried setting a cookie expiration date in the past?

Alex Bailey
  • 1,679
  • 10
  • 15
  • I tried your script ctest.php on my firefox 3.6 (osx) and it works as intended. After I set the cookie and open the page I see it when I close the browser and reopen it again it's gone. Tried it on safari same thing. Must be related to your FF. – Alex Bailey Nov 17 '10 at 15:15
0

Firefox appears to require that you include all parameters, or it will ignore the expiration and treat the cookie as a session cookie

<?php setcookie( "name", "value", "past_timestamp", "path", "domain" ); ?> 

more info here

IndieBoy
  • 1,102
  • 3
  • 14
  • 25
0

Is a residual process running? Some plugins for FF get stuck as a background process when the browser is closed, or the download manager may still be open etc.. is FF definitely terminated?

Also, this may result from a profile corruption, trial with a new profile (run FF with firefox.exe -ProfileManager)

Also, see here:

http://forums.mozillazine.org/viewtopic.php?f=38&t=1465575

Notably regarding the corruption in the cookie manager:

The cookies file may have become corrupt. Since you are deleting all cookies try this: 1) Shut down Firefox. 2) Go to your profile. ( http://kb.mozillazine.org/Profile_folder_-_Firefox ) 3) Backup and rename the cookies.txt (if it exists) and cookies.sqlite files to a different name, i.e. old_xxxx

SW4
  • 69,876
  • 20
  • 132
  • 137