Thread: PHP Sessions
View Single Post
  #4  
Old 05-04-2009, 05:22 PM
welcomewiki welcomewiki is offline
Member
 
Join Date: Dec 2008
Location: India
Posts: 80,542
Destroying a Session

If you wish to delete some session data, you can use the unset() or the session_destroy() function.


The unset() function is used to free the specified session variable:




unset($_SESSION['views']);
?>



You can also completely destroy the session by calling the session_destroy() function:




session_destroy();
?>

Note: session_destroy() will reset your session and you will lose all your stored session data.
Reply With Quote