I was wondering if there is a way to check if a cookie is expired because i want to do an auto logout script when the user is inactive for a certain amount of time. For testing purposes i made it 10 seconds. here is the code i have so far but it doesnt log you out.
PHP Code:
$pass md5($_SERVER[PHP_AUTH_USER]);
$user) AND ($pass)) {
setcookie("PHPSESSID"$_COOKIE['PHPSESSID'], time()+10);
['user'] = $_SERVER[PHP_AUTH_USER];
$_SESSION['pass'] = md5($_SERVER[PHP_AUTH_USER]);
$_SESSION['userip'] = $_SERVER['REMOTE_ADDR'];    
$sess_id session_id();

$_SESSION['timestamp'])) {
$result $db->query("INSERT INTO user_tracking(id, user, ip, tstamp) VALUES('', '{$_SESSION['user']}', '{$_SESSION['userip']}', NOW())");
$result) {
"Error inserting user into tracking database".mysql_error());
"You are now being logged out due to inactivity";
"<meta http-equiv=\"refresh\" content=\"5;url=http://www.midtownvillage.org/test.php\">";