ID: 11569
Updated by: sas
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Closed
Bug Type: Session related
Operating System: Solaris 8 / Sparc
PHP Version: 4.0.5
New Comment:
session_unset() will delete the variables from the global scope. So, instead of
global $a;
session_unset();
$a = "foo";
you need to use this:
session_unset();
global $a; # establish link to global variable
$a = "foo";
Previous Comments:
------------------------------------------------------------------------
[2001-06-19 19:47:48] [EMAIL PROTECTED]
I adopted most of this little script from user feedback in
the session_unset()'s annotations. I ran into the same
problem, and think that it demonstrates it well.
<?php
function
dummy()
{
global $a;
session_unset();
$a= 'foo';
echo "<br>2. ".session_register('a');
}
session_start();
$a= 'foo';
session_register('a');
echo "<br>1. $a";
dummy();
echo "<br>3. $a";
?>
If you run it, you'll see that, even though the second
session_register() returns TRUE, $a is not registered again,
and remains unset.
This bug does not allow me to be paranoid enough coding a
login-protected website.
Thanks.
------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11569&edit=1
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]