note 11014 deleted from ref.session by sniper
| From: | sniper@php.net | Date: | Sun, 28 Jul 2002 01:15:56 +0000 |
| Subject: | note 11014 deleted from ref.session by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-33802@lists.php.net to get a copy of this message | ||
It seems that session_unregister(name) unsets all variables with the same name,
e.g. this code will kill variable "login", that you might have got from an HTTP form and
that you're going to use in your script
session_start();
session_unregister("login");
....
echo $login; // You'll see nothing
I had to add
reset ($HTTP_POST_VARS);
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
$$key = $val;
}
to set back the variables I have got from form.
--
Editor's Note: session_unregister() does not care if value is session variable or not. i.e. it
unregister the variable from session and unset the variable.