#32769 [NEW]: Session cookies with non-default lifetimes not expiring in Firefox

From: Date: Tue, 19 Apr 2005 14:42:06 +0000
Subject: #32769 [NEW]: Session cookies with non-default lifetimes not expiring in Firefox
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-77888@lists.php.net to get a copy of this message
From: oc106 at york dot ac dot uk Operating system: Win XP Pro SP2 PHP version: 5CVS-2005-04-19 (dev) PHP Bug Type: Session related Bug description: Session cookies with non-default lifetimes not expiring in Firefox Description: ------------ If session lifetime is set to other than 0 (i.e. other than expire at end of session), then this is not honoured in Firefox (1.0.2), but is in other browsers (tested in IE6, Opera 7.54, Mozilla 1.8) Cookies set with setcookie() with non-default lifetimes expire fine. However, manually setting a cookie with the session cookie name (i.e. setcookie("PHPSESSID", ...)) with a lifetime causes the same problems as using the session functions. Running on Apache 2.0.52, and using original php.ini-dist settings. (Also tested in PHP 5.0.4 release) Reproduce code: --------------- <?php /* * Note: this code assumes server time is the same as user * time (e.g. run from localhost). */ session_set_cookie_params(30); session_start(); setcookie("test", "foo", time() + 30, "/"); /* * uncommenting this line and commenting out the session * functions produces the same problem. */ // setcookie("PHPSESSID", "foo", time() + 30, "/"); print_r($_COOKIE); ?> Expected result: ---------------- In Firefox, after loading the page produced by the above code, viewing Tools->Options->Privacy->View Cookies, the list shows two cookies for the page, "test" and "PHPSESSID". They should both be shown to expire 30 seconds after the page was loaded (this behaviour can be observed in Mozilla via Tools->Cookie Manager->Manage Stored Cookies). If the page is refreshed after more than 30 seconds, the print_r() statement should show an empty array. Actual result: -------------- "test" is shown as expiring 30 seconds after the page was loaded, however "PHPSESSID" is shown as expiring "at end of session". When refreshed after more than 30 seconds, the print_r() statement still shows the existence of $_COOKIE["PHPSESSID"]. This only occurs in Firefox (out of the browsers listed above). -- Edit bug report at http://bugs.php.net/?id=32769&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32769&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32769&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32769&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=32769&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=32769&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=32769&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=32769&r=needscript Try newer version: http://bugs.php.net/fix.php?id=32769&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=32769&r=support Expected behavior: http://bugs.php.net/fix.php?id=32769&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=32769&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=32769&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=32769&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32769&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=32769&r=dst IIS Stability: http://bugs.php.net/fix.php?id=32769&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=32769&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=32769&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=32769&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=32769&r=mysqlcfg

« previous php.bugs (#77888) next »