lets say i have a log in screen. gets form data, goes to a proc page. tests user name and pass against a db and then relocates the user to a "private page" (it, and other private pages). all private pages call a function to do session checking.
first question.. is this a bad way of doing it
function session_check(){
session_start();
if (!session_is_registered("MEMBER_SESSION")){
header("Location: index.php");
exit();
}
}
second question... lets say i have many ppl "loging" on to the site... can the sessions get confused with another use. they will be getting stuff from a db bassed on thier ID number in the db.. this number is obtained at log in time when i do the user pass look up.
$status = authenticate($user, $pass);
if ($status != 0){
// initiate a session
session_start("PLAYER_SESSION");
session_register("PLAYER_SESSION");
$PLAYER_SESSION = "PLAYER".$user;
session_register("SESSION_UNAME");
$SESSION_UNAME = $user;
session_register("SESSION_UID");
$SESSION_UID = $status;
// redirect to protected page
header("Location: ../player.php");
exit();
}
and thats how i log ppl in
so if many ppl log on.. do i have a problem?
thanks for any input