Switch to full style
:read: Start PHP with us. Includes topics to help you in php
Post a reply

Delete session variable

Sun Oct 26, 2008 8: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'].".";

?>




Post a reply
  Related Posts  to : Delete session variable
 different between Local variable and Global variable     -  
 Variable interpolation     -  
 transient variable     -  
 Unset variable     -  
 PHP variable in javascript     -  
 how to call a global variable?     -  
 Testing the Type of a Variable     -  
 Passing a Reference Variable     -  
 Variable Size Arrays     -  
 static variable defined in function     -  

Topic Tags

PHP Sessions