added old project files
This commit is contained in:
23
php/checkSessionValidity.php
Executable file
23
php/checkSessionValidity.php
Executable file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
if(isset($_COOKIE['LAST_ACTIVITY']))
|
||||
{
|
||||
if (time() - $_COOKIE['LAST_ACTIVITY'] > 86400) {
|
||||
// last activity is more than 10 minutes ago
|
||||
|
||||
session_destroy();
|
||||
echo "you are logged out because of the 10 minutes...";
|
||||
exit();
|
||||
} else {
|
||||
// update last activity timestamp
|
||||
//echo "updated timestamp";
|
||||
//printf("timestamp updated %d seconds left", 3600 - (time() - $_SESSION['LAST_ACTIVITY']));
|
||||
$_COOKIE['LAST_ACTIVITY'] = time();
|
||||
}
|
||||
}else
|
||||
{
|
||||
echo "no cookie...";
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
?>
|
Reference in New Issue
Block a user