|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-12-30 06:58 UTC] anders at gatefive dot 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);
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 09:00:01 2025 UTC |
session_unregister('test') should work. Alternatively, you can use unset($_SESSION['test']);