note 79783 deleted from function.session-unregister by felipe
| From: | felipe@php.net | Date: | Sat, 15 Dec 2007 15:27:04 +0000 |
| Subject: | note 79783 deleted from function.session-unregister by felipe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-133566@lists.php.net to get a copy of this message | ||
Note Submitter: w_Patrick_Gale
Reason: 1
----
To remove all of the session variables (clear the session variables saved) loop through the session
array and pop off all of the elements like so. This might be used in a 'log off' function
to remove the user sessions.
<?php
foreach ($_SESSION as $key) {
array_pop($_SESSION);
}
?>