Session questions
| From: | Jason Rennie | Date: | Mon, 16 Jul 2001 08:14:10 +0000 |
| Subject: | Session questions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-58016@lists.php.net to get a copy of this message | ||
Hi all,
This might be a dumb question but can anybody tell me why on earth this
doesn't work ?
session_start()
$logged_in = session_is_registered("auth");
if($logged_in != true)
{
if(!(pam_auth($usernamelogin,$pass,&$error)))
{
// send an error if it doens't login in
}
else
{
session_register($username);
session_register($auth);
$HTTP_SESSION_VARS["username"] = $usernamelogin;
$HTTP_SESSION_VARS["auth"] = 1;
}
$user = $HTTP_SESSION_VARS["username"];
start_page("$user's home page");
}
Now the problem is, that although it auth's ok, and username and auth seem
to be set, anytime i try to access $HTTP_SESSION_VARS["username"] it is
blank.
Also if i try to use $HTTP_SESSION_VARS["username"] directly in a string i
get and error about expecting one of a variety of string types.
Sorry if this is a really dumb question.
Jason