A session variable can be destroyed with a call to session_unregister(). : Session Variables « Cookie Session « PHP






A session variable can be destroyed with a call to session_unregister().

 
Its syntax is: boolean session_unregister (string varname)

<?
session_start();
session_register('username');
// ...use the variable $username as needed, then destroy it.
session_unregister('username');
session_destroy();
?>
  
  








Related examples in the same category

1.Accessing Session Variables
2.Adding Session Data
3.Checking Session Data
4.Reading Session Data
5.Registering Variables with a Session
6.Registering an Array Variable with a Session
7.Storing Complex Data Types in Sessions
8.Storing Complex Data Types to session
9.Storing Simple Data Types in Sessions