RE: [PHP] Session Variables
| From: | Johnson, Kirk | Date: | Wed, 25 Jul 2001 20:55:28 +0000 |
| Subject: | RE: [PHP] Session Variables | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-59612@lists.php.net to get a copy of this message | ||
> Is there anyway to prevent session variables from being
> overwritten by a get string?
PHP will do this automatically *if* you initialize your session variables to
*anything* as soon as you register them. For example,
session_register("sess_auth");
$sess_auth = "";
If you do this, then session variables will overwrite GET/POST variables,
and the latter will need to be retrieved from the $HTTP_(GET/POST)_VARS
arrays.
Another approach is to turn register_globals off in php.ini. This is a long
one to explain, but has been covered quite bit here- search the archive.
Kirk