note 11014 modified in ref.session by yohgaki
| From: | yohgaki@php.net | Date: | Sat, 19 Jan 2002 06:35:45 +0000 |
| Subject: | note 11014 modified in ref.session by yohgaki | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-25107@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.
--was--
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.
http://www.php.net/manual/en/ref.session.php