session_unregister not working properly

From: Date: Tue, 13 Nov 2001 14:57:02 +0000
Subject: session_unregister not working properly
References: 1  Groups: php.dev php.qa 
Request: Send a blank email to php-dev+get-70356@lists.php.net to get a copy of this message
While testing 4.1.0RC2 I noticed that the following script does not work as expected: <?php session_register("count"); echo $_SESSION["count"]++; session_unregister("count"); ?> When I set register_globals=off the counter is incrementing although PHP has to unregister the variable from the session. Further tests showed that when register_globals is set to 'on', the variable is unregistered properly. It also works when you use the global variable $count. I noticed that when you replace session_unregister("count") with unset($_SESSION['count']); the variable is also properly deleted/"unregistered". I think that this is not they way it should work and PHP should be fixed so that session_unregister properly deletes the variable. But if this is the intended behavior of php now, then it should be documented. I tested on: Windows 2000 Pro + SP2, Apache 1.3.22, fresh PHP 4.1.0RC2 build, created with VC++ 6 using only the extensions build in by default Christoph

« previous php.dev (#70356) next »