#47065 [Opn->Bgs]: function session_unset() reset local variables

From: Date: Sun, 11 Jan 2009 22:31:21 +0000
Subject: #47065 [Opn->Bgs]: function session_unset() reset local variables
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-132761@lists.php.net to get a copy of this message
ID: 47065 Updated by: johannes@php.net Reported By: opurahman at gmail dot com -Status: Open +Status: Bogus Bug Type: Session related Operating System: Linux PHP Version: 5.2.8 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Note: If $_SESSION (or $HTTP_SESSION_VARS for PHP 4.0.6 or less) is used, use unset() to unregister a session variable, i.e. unset ($_SESSION['varname']);. session_unset() is to be ued when using register_globals() which is not advised. Previous Comments: ------------------------------------------------------------------------ [2009-01-11 08:37:22] opurahman at gmail dot com Description: ------------ function session_unset() reset local variables. I was trying to reset session variables after storing two values from session. It reset my local variables. Lets take a look into the codes bellow. Reproduce code: --------------- session_start(); $message = sprintf('%s', $_SESSION['message']); echo('Here Message: # ' . $message . '<br />'); session_unset(); echo('Here Message: # ' . $message . '<br />'); // in this line, the variable $message has been unset. Expected result: ---------------- It should display the value of $message ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=47065&edit=1

« previous php.bugs (#132761) next »