Lost Sessions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Forcypal

    #1

    Lost Sessions

    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_pass wd = md5($GLOBALS['encrypt_key'] .
    $_POST['login_passwd']);

    $userid = $_POST['login_userid'];
    $passwd = $encrypted_pass wd;
    }
    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_registe r("userid");
    $_SESSION['userid'] = $userid;

    session_registe r("passwd");
    $_SESSION['passwd'] = $passwd;

    if ($GLOBALS['site']['adminuserid'] != $userid ||
    $GLOBALS['site']['adminpasswd'] != $passwd)
    {
    session_unset() ;
    session_destroy ();
    _display_login( "Bad UserID or Password!");
    exit;
    }

    ----------------------------------------------------------------------------
    ----


  • KAH

    #2
    Re: Lost Sessions

    "Forcypal" <go.to.www.heye s.co.uk@for.my. email.address> wrote in
    news:bfrko2$p6g $1@hercules.bti nternet.com:
    [color=blue]
    > 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.[/color]

    Are you sure that it's not just the session or cookie expiring?

    KAH

    Comment

    Working...