<?php
$expireAfter = 5; //expire session after 5 mints.
if(isset($_SESSION['last_action'])){
$secondsInactive = time() - $_SESSION['last_action'];
$expireAfterSeconds = $expireAfter * 60;
if($secondsInactive >= $expireAfterSeconds){
unset($_SESSION['vendor']);
}
}
$_SESSION['last_action'] = time();
?>
$expireAfter = 5; //expire session after 5 mints.
if(isset($_SESSION['last_action'])){
$secondsInactive = time() - $_SESSION['last_action'];
$expireAfterSeconds = $expireAfter * 60;
if($secondsInactive >= $expireAfterSeconds){
unset($_SESSION['vendor']);
}
}
$_SESSION['last_action'] = time();
?>
No comments:
Post a Comment