Posted: Thu Nov 16, 2006 11:47 am
I've got it to work I set the timeout value as a session variable
But on the welcome page, I did this :
This way, when i logged in successfully, i could see the current time and the timeout time. On refreshing the page repeatedly, i could see the current time increasing by seconds and when it reached the timeout time, the session was unset and i got logged out.
thanks for your help, y'all
Code: Select all
$_SESSION['timeout']=time()+30;Code: Select all
$timenow = time();
if ($timenow>$timeout)
{
session_unset();
session_destroy();
print "not logged in";
print "<script>";
print " self.location='login.php';";
print "</script>";
}
else
{
print "logged in";
echo "Current Time".$timenow."\n";
echo "Timeout". $timeout."\n";
---rest of the page---thanks for your help, y'all