Bug #14767 Updated: Bug unsetting vars using $_SESSION
| From: | sander@php.net | Date: | Wed, 02 Jan 2002 16:33:36 +0000 |
| Subject: | Bug #14767 Updated: Bug unsetting vars using $_SESSION | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-75607@lists.php.net to get a copy of this message | ||
ID: 14767
Updated by: sander
Reported By: anders@gatefive.fi
Old Status: Open
Status: Bogus
Bug Type: Session related
Operating System: Linux 2.4
PHP Version: 4.1.1
New Comment:
session_unregister('test') should work. Alternatively, you can use
unset($_SESSION['test']);
Previous Comments:
------------------------------------------------------------------------
[2001-12-30 06:58:28] anders@gatefive.fi
In a project I work on I ran into something I would say
is a bug..
When I call the page with ?debug=3 the session var 'test'
gets the value "howdy" and gets stored (no need to call
session_register('test'); (odd?)). After this there seem
to be no way of unsetting/removing this session var..
At least non of the methods below works. Bug?
unset in #2 (see below) removes the var, so it doesn't
show up in the var_dump (#6), but upon calling the page again with ?debug=2 (only show sess-vars),
it shows up
again.
At the same: $_GETand $_SERVER is displayed in phpinfo, but not $_SESSION. Another bug?
In php.ini:
register_globals = On
Script:
// #1
if ($debug==3)
$_SESSION['test'] = "howdy";
// #2
if ($debug==4)
unset($_SESSION['test']);
// #3
if ($debug==5)
unset($test);
// #4
if ($debug==6)
session_unregister($test);
// #5
if ($debug==7)
session_unregister($_SESSION['test']);
// #6
if ($debug>1)
var_dump($_SESSION);
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=14767&edit=1