|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-06-17 21:41 UTC] ccjeagle at ms6 dot hinet dot net
[2001-06-18 08:56 UTC] sniper@php.net
[2001-06-18 21:24 UTC] ccjeagle at ms6 dot hinet dot net
[2001-06-19 12:26 UTC] sniper@php.net
[2001-06-20 06:27 UTC] cynic@php.net
[2001-11-18 01:37 UTC] sebastian@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 07:00:01 2025 UTC |
It seems that session_unregister() should "remove" a var from the session, isn't it ? -------test.php <?php // First script, register the var session_start() ; session_register("somevar") ; $HTTP_SESSION_VARS["somevar"] = "abc" ; ?> <a href="test2.php">Click Here</a> -------test2.php <?php // Second script, unregister the var session_start() ; echo "somevar is " . $HTTP_SESSION_VARS["somevar"] ; session_unregister("somevar") ; ?> <br><a href="test3.php">Click here again</a> --------test3.php <?php // The third script, see the result session_start() ; print_r($HTTP_SESSION_VARS) ; session_unset() ; print_r($HTTP_SESSION_VARS) ; session_destroy() ; ?> With the enable-trans-sid turned on, the result of the third script is : Array ( [somevar] => abc ) Array ( ) Is it a bug ? How shoud I do if I want to "remove" some variables from session but KEEP THE OTHERS unchanged ? Best Regards