note 15337 added to function.session-unset

From: Date: Thu, 06 Sep 2001 06:01:57 +0000
Subject: note 15337 added to function.session-unset
Groups: php.notes 
Request: Send a blank email to php-notes+get-17710@lists.php.net to get a copy of this message
session_unregister() unregisters a session variable but you can still access it using $HTTP_SESSION_VARS[]..................... if you run the following php file; <? session_start(); session_register('foo'); $HTTP_SESSION_VARS['foo'] = 'Hello'; echo "The value of foo when it is registered: ".$HTTP_SESSION_VARS['foo']."\<br\>"; session_unregister('foo'); echo "The value of foo after it is unregistered: ".$HTTP_SESSION_VARS['foo']."\<br\>"; if(session_is_registered('foo')) echo "foo is still registered!"; else echo "foo is not registered anymore!"; ?> I got the following output in my browser; The value of foo when it is registered: Hello The value of foo after it is unregistered: Hello foo is not registered anymore! http://www.php.net/manual/en/function.session-unset.php

« previous php.notes (#17710) next »