This is a discussion on Lost Sessions within the PHP Language forums, part of the PHP Programming Forums category; Could somebody please tell me what I am doing wrong. I have spent that past couple of days chasing an ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Could somebody please tell me what I am doing wrong.
I have spent that past couple of days chasing an intermittent session problem where the session just gets lost and I return to the login screen. ---------------------------------------------------------------------------- ---- PHP Session Code ---------------------------------------------------------------------------- ---- session_start(); header("Cache-control: private"); //IE 6 Fix if (isset($_POST['login_userid']) && isset($_POST['login_passwd'])) { $encrypted_passwd = md5($GLOBALS['encrypt_key'] . $_POST['login_passwd']); $userid = $_POST['login_userid']; $passwd = $encrypted_passwd; } else { $userid = $_SESSION['userid']; $passwd = $_SESSION['passwd']; } if($GLOBALS['do'] == "logout" || !isset($userid)) { session_unset(); session_destroy(); _display_login("Please login to access the Site Administrator."); exit; } session_register("userid"); $_SESSION['userid'] = $userid; session_register("passwd"); $_SESSION['passwd'] = $passwd; if ($GLOBALS['site']['adminuserid'] != $userid || $GLOBALS['site']['adminpasswd'] != $passwd) { session_unset(); session_destroy(); _display_login("Bad UserID or Password!"); exit; } ---------------------------------------------------------------------------- ---- |
|
|||
|
"Forcypal" <go.to.www.heyes.co.uk@for.my.email.address> wrote in
news:bfrko2$p6g$1@hercules.btinternet.com: > I have spent that past couple of days chasing an intermittent session > problem where the session just gets lost and I return to the login > screen. Are you sure that it's not just the session or cookie expiring? KAH |