php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15276 Error with unset();
Submitted: 2002-01-29 10:07 UTC Modified: 2002-02-02 22:28 UTC
From: vvtk at stealthcomp dot com Assigned:
Status: Not a bug Package: Session related
PHP Version: 4.1.1 OS: RedHat 7.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
25 - 22 = ?
Subscribe to this entry?

 
 [2002-01-29 10:07 UTC] vvtk at stealthcomp dot 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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-02 22:28 UTC] yohgaki@php.net
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().

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 20:01:34 2024 UTC