session_set_cookie_params broken in 4.0.6
| From: | Nick Lindridge | Date: | Sun, 15 Jul 2001 15:14:15 +0000 |
| Subject: | session_set_cookie_params broken in 4.0.6 | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-60055@lists.php.net to get a copy of this message | ||
The web site bugs list reported an error
"Warning: Could not execute mail delivery program in /local/Web/sites/phpweb/bugs.php on line
101"
so I'm posting manually.
rom: nick@macaw.demon.co.uk
Operating system:
PHP version: 4.0.6
PHP Bug Type: Session related
Bug description: session_set_cookie_params broken
This assumes default settings in php.ini
Description: the effect of session_set_cookie_params() is documented to
last only for the duration of the calling script, however it's affect
appears to last globally forever. i.e. After using a session named
"SID1" with a cookie timout of 5 seconds, subsequently using a
session "SID2" with default cookie parameters will also have a
timeout of 5 seconds.
The following two scripts will illustate this.
<?php
session_name("SID1");
session_set_cookie_params(5,"/");
session_start();
echo "Sid is [",session_id(),"]\n";
?>
Loading this, SID1 changes every 5 seconds as expected.
Loading the following, however, SID2 also changes every 5 seconds, even
though cookie params have *not* been set in this script.
<?php
session_name("SID2");
session_start();
echo "Sid is [",session_id(),"]\n";
?>
Nick