note 20694 deleted from ref.session by sniper

From: Date: Sun, 28 Jul 2002 00:58:14 +0000
Subject: note 20694 deleted from ref.session by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-33759@lists.php.net to get a copy of this message
The following code fragment works around the fact that my PHP4.1.2 (iis/cgi) does not work as advertised. You can use it for whatever other reason you choose. # Include this code somewhere if you're having trouble with $_SESSION not # seeming to work as advertised. session_start(); function Work_around_session_bogosity() { foreach(array_keys($GLOBALS['HTTP_SESSION_VARS']) as $k) { if (!isset($_SESSION[$k])) session_unregister($k); } foreach($_SESSION as $k=>$v) { if (!session_is_registered($k)) session_register($k); $GLOBALS['HTTP_SESSION_VARS'][$k] = $v; $GLOBALS[$k] = $v; } } register_shutdown_function('Work_around_session_bogosity');

« previous php.notes (#33759) next »