Sessions with register_globals = Off
| From: | A Complete Luser | Date: | Sat, 16 Dec 2000 18:08:59 +0000 |
| Subject: | Sessions with register_globals = Off | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-30674@lists.php.net to get a copy of this message | ||
Hi all,
I am trying to implement sessions to authenticate users to my site. I
have register_globals = Off; to force developers on the machine to use
$HTTP_GET_VARS and $HTTP_POST_VARS
But once I do a session register, I can't seem to access the variables
later. I have looked in the sess file in /tmp and the session doesn't
seem to be stored.
I have tried the following :
session_start();
session_register("user_level");
session_register("user_email_address");
session_register("user_first_name");
session_register("user_last_name");
session_register("user_name");
session_register("auth");
return("YES");
Then in the function that called this, I do
printf("User_level = %s<br>", $user_level);
printf("User_name = %s<br>", $user_name);
I also tried
printf("User_level = %s<br>", $HTTP_SESSION_VARS["user_level"]);
printf("User_name = %s<br>", $HTTP_SESSION_VARS["user_name"]);
neither of these found anything... Is there any way to do this without
turning global_vars on ?
Thanks,
--
- A Complete Luser
E-mail: acompleteluser@penguinpowered.org.uk