Removing/unsetting session variables.
| From: | Alain Williams | Date: | Wed, 24 Dec 2003 13:22:24 +0000 |
| Subject: | Removing/unsetting session variables. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-173294@lists.php.net to get a copy of this message | ||
I have several variables that I set in a session - to record that a user is logged in.
I want to be able to unset them - when they log out.
$_SESSION['PERMS_USER'] = 'fred';
Sets the variable quite nicely, I can also change it and the change is recorded.
I cannot unset it. I have tried (in various combinations):
unset($_SESSION['PERMS_USER']);
unset($HTTP_SESSION_VARS['PERMS_USER']);
session_unregister($SESSION['PERMS_USER']);
session_unregister($HTTP_SESSION_VARS['PERMS_USER']);
None of which have any effect.
What should I do ?
Thanks
Merry Christmas.
--
Alain Williams
#include <std_disclaimer.h>
FATHERS-4-JUSTICE - Campaigning for equal rights for parents and the
best interests of our children. See http://www.fathers-4-justice.org