i have a really wierd random bug in authentication. i am not sure if is a server problem, or my code.
here's what i am using to authenticate users
if($pass == $chkpass AND $chkuser == $user)
{
@session_start();
session_register("user" , "userlevel");
$HTTP_SESSION_VARS["user"] = $HTTP_POST_VARS["user"];
$HTTP_SESSION_VARS["userlevel"] = $userlevel;
session_write_close();
header("Location: admin.php?".SID);
}
else { $chkpass = false; }
}
}
here's what checks for them on the next page.
@session_start();
if(is_array($HTTP_SESSION_VARS)) {
extract($HTTP_SESSION_VARS);
var_dump ($HTTP_SESSION_VARS);
}
i am looking for user and userlevel. This works randomly well.. i can refresh the page several times, and will get this:
array(2) { ["user"]=> &string(5) "guest" ["userlevel"]=> &string(1) "a" }
or this:
array(0) { }
then i can hit refresh and get a semingly random occurance of either.
i don't get it please help.
thanks