Delete session variable

Sun Oct 26, 2008 7:36 pm

Delete a session variable
Code:

<?php

   session_start
();

   $_SESSION['username'] = "Joe";
   echo "Your username is: ".$_SESSION['username'].".<br />";
   
   
/* Delete the session variable. */
   unset($_SESSION['username']);

   /* Demonstrate that session variable is indeed gone. */
   echo "Username now set to: ".$_SESSION['username'].".";

?>




  Related Posts  to : Delete session variable
 different between Local variable and Global variable     -  
 PHP variable in javascript     -  
 Variable interpolation     -  
 transient variable     -  
 Unset variable     -  
 how to call a global variable?     -  
 Testing the Type of a Variable     -  
 Passing a Reference Variable     -  
 Variable Size Arrays     -  
 Changing the Type of a Variable with settype()     -  

Topic Tags

PHP Sessions