Lost Sessions

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-25-2003
Forcypal
 
Posts: n/a
Default 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_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;
}

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


Reply With Quote
  #2 (permalink)  
Old 07-25-2003
KAH
 
Posts: n/a
Default Re: Lost Sessions

"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
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:33 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0