Delete session variable : Session Variables Delete « Cookie Session « PHP






Delete session variable


<?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 examples in the same category

1.Deleting Existing Session Variables