this expire system wont work.. whats wrong with it?
When you login: (login page)
<?php
session_start();
$_SESSION['start'] = time();
$_SESSION['expire'] = $_SESSION['start'] + (3600);
?>
The page you goto after you login: (logged in page)
<?php
session_start();
$now = time();
if($now > $_SESSION['expire'])
{
session_destroy();
echo "session expired!";
}
else
{
echo $myusername;
}
?>
When im at the logged in page, and i refresh it just says "session expired!"