Bug #11569 Updated: session_register() not working after session_unset(); session_destroy();

From: Date: Tue, 10 Jul 2001 09:35:23 +0000
Subject: Bug #11569 Updated: session_register() not working after session_unset(); session_destroy();
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-59513@lists.php.net to get a copy of this message
ID: 11569
Updated by: sas
Reported By: antipode@thpoon.com
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] antipode@thpoon.com

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



Thread (1 message)

  • sas@php.net
  • Unknown Message
    • sas@php.net
« previous php.dev (#59513) next »