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

From: Date: Tue, 19 Apr 2005 20:41:14 +0000
Subject: #32769 [Opn->Bgs]: Session cookies with non-default lifetimes not expiring in Firefox
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-77927@lists.php.net to get a copy of this message
ID: 32769 Updated by: sniper@php.net Reported By: oc106 at york dot ac dot uk -Status: Open +Status: Bogus Bug Type: Session related Operating System: Win XP Pro SP2 PHP Version: 5CVS-2005-04-19 (dev) New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. Previous Comments: ------------------------------------------------------------------------ [2005-04-19 16:42:05] oc106 at york dot ac dot uk 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 this bug report at http://bugs.php.net/?id=32769&edit=1

« previous php.bugs (#77927) next »