Bug #15276 Updated: Error with unset();
| From: | yohgaki@php.net | Date: | Sun, 03 Feb 2002 03:28:31 +0000 |
| Subject: | Bug #15276 Updated: Error with unset(); | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-78929@lists.php.net to get a copy of this message | ||
ID: 15276
Updated by: yohgaki@php.net
Reported By: vvtk@stealthcomp.com
Old Status: Open
Status: Bogus
Bug Type: Session related
Operating System: RedHat 7.1
PHP Version: 4.1.1
New Comment:
Use session module as current manual explains.
Your script does not work as you expected.
You are not supposed to unset() session variable with unset().
Use session_unregister() for global session vars instead.
If you want to save session variable, don't unset().
Previous Comments:
------------------------------------------------------------------------
[2002-01-29 10:07:44] vvtk@stealthcomp.com
Simple Script:
<?
session_id("TESTSESSION");
session_start();
session_register("TEXN_ARRAY");
echo $TEXN_ARRAY."<BR>";
unset($TEXNS_ARRAY);
$TEXN_ARRAY = "Value 1";
echo $TEXN_ARRAY."<BR>";
?>
After execution we have:
Value 1
Change line 7 to $TEXN_ARRAY = "Value 2";
After execution we have:
Value 1
Value 2
Change line 7 to $TEXN_ARRAY = "Value 3";
After execution we have:
Value 1 <-!!!!!!!!!!!! We expected Value 2 !!!
Value 3
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=15276&edit=1