note 28801 added to function.session-unregister

From: Date: Fri, 24 Jan 2003 09:37:52 +0000
Subject: note 28801 added to function.session-unregister
Groups: php.notes 
Request: Send a blank email to php-notes+get-42686@lists.php.net to get a copy of this message
Haven't used sessions in a while, while using PHP 4.1.2 I had the setting that register_globals is on and I was using $_SESSION for registering a session variable, e.g. $_SESSION['user']['status'] = 'whatever';. While trying to unset the session with unset($_SESSION['user']); it failed all the time for me. This approach is documented on this page: "Note: If $_SESSION (or $HTTP_SESSION_VARS for PHP 4.0.6 or less) is used, use unset() to unregister a session variable. " However, that didn't work for me. Crying for help, Derick explained that I've to use $_SESSION['user'] = NULL; and that "unset will only unset the reference to the session data". Since I can't check this with a more recent (4.3.0 as of now) version I'm not filing a report. -- http://www.php.net/manual/en/function.session-unregister.php http://master.php.net/manage/user-notes.php?action=edit+28801 http://master.php.net/manage/user-notes.php?action=delete+28801 http://master.php.net/manage/user-notes.php?action=reject+28801

« previous php.notes (#42686) next »