10.6 Deleting All the Session Variables
TechniqueUse the session_destroy() function to wipe out the session: <?php session_start(); session_register("foo"); session_register("foobar"); session_register("foobarina"); $foo = array ("banana", "apple", "orange", "mango"); $foobar = "fruits"; $foobarina = "vegetables"; session_destroy(); print $foobar; ?> CommentsThe session_destroy() function will delete the session data from the session store. Note that it will not delete session variables' contents. For that, you need to use the session_unset() function to go through all session variables and remove them from the symbol table. |