ok i know there's another thread about this here already, however, this is a much different question
i have written a login script and it does work for the most part however, my session_id() isnt' being produced.... i have no idea why, it catches the session_name() just fine but not the id.. ehre's that portion of the script
function checkLoggedIn($status) {
switch($status) {
//if yes, make sure that the user is logged in
case "yes":
if(!$_SESSION['session']['loggedIn']) {
header("Location: index.php");
exit;
}
break;
//if no check that the user isn't logged in
case "no":
if($_SESSION['session']['loggedIn']) {
//set a varible for session name and id
header("Location: member.php?".session_name()."=".session_id());
}
break;
}
//now all is good so return true
return true;
} // end function check status
another problem is that when I call the function back checkLoggedIn("yes"); in the member.php page it still goes back to index.php, like runs a loop on me, so i'm thinking since it works without the checkLoggedIn("yes"); that my session isn't being produced correctly... here's the session portions of my script
function checkMemSession($login, $pass) {
$_SESSION['session']['login']=$login;
$_SESSION['session']['password']=$pass;
$_SESSION['session']['loggedIn']=true;
}//end function checkMemSession
function flushSession() {
unset($_SESSION['session']);
//has been uset so destroy it
session_destroy();
return true;
}// end function flushSession
how come my session doesnt' seem to be working out right? i've compared it to other scripts that i've seen and ti seems to look pretty much the same to me, any ideas?
thanks alot
😃