Forum Moderators: coopster

Message Too Old, No Replies

Handling Sessions! Plz Help

         

An156

1:51 pm on Mar 29, 2009 (gmt 0)

10+ Year Member



Hi All..
I'm facing problem wid session as my both session value becomes true.

I have Login.php,Home.php and AccInfo.php
all is working fine. but when i access accinfo.php, by login as an emp then it display
"admin is logged in" in spite of "emp is logged in"
if i destroy the session then i can not access the home.php as session is expired!

Plz help! here is the code

<?php
session_start();
if(isset($_SESSION['adminloginid']))
{ echo 'admin is logged in';
}

else if(isset($_SESSION['emploginid']))
{ echo 'employee is logged in';
}
else
{ echo 'session expired';
}
?>

eeek

1:59 pm on Mar 29, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You may want to actually check the value of $_SESSION['adminloginid'] instead of just looking to set if it is set.

d40sithui

2:44 pm on Mar 30, 2009 (gmt 0)

10+ Year Member



Looks like the way that you assigned your session variables are to blame - probably in login.php? Recheck that and post relevant code here if you cannot find it.