note 79783 added to function.session-unregister

From: Date: Wed, 12 Dec 2007 18:55:19 +0000
Subject: note 79783 added to function.session-unregister
Groups: php.notes 
Request: Send a blank email to php-notes+get-133395@lists.php.net to get a copy of this message
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); } ?> ---- Server IP: 209.41.74.194 Probable Submitter: 152.2.168.205 ---- Manual Page -- http://www.php.net/manual/en/function.session-unregister.php Edit -- https://master.php.net/note/edit/79783 Del: integrated -- https://master.php.net/note/delete/79783/integrated Del: useless -- https://master.php.net/note/delete/79783/useless Del: bad code -- https://master.php.net/note/delete/79783/bad+code Del: spam -- https://master.php.net/note/delete/79783/spam Del: non-english -- https://master.php.net/note/delete/79783/non-english Del: in docs -- https://master.php.net/note/delete/79783/in+docs Del: other reasons-- https://master.php.net/note/delete/79783 Reject -- https://master.php.net/note/reject/79783 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#133395) next »