Wednesday, April 29, 2009

PHP SCRIPT-- TO TIME OUT THE SESSION AFTER THE PARTICULAR TIME [SESSION TIME OUT]

<?php
if (!isset($_SESSION['timeout_idle'])) {
$_SESSION['timeout_idle'] = time() + MAX_IDLE_TIME; //set time at the first time of writing script
} else {
if ($_SESSION['timeout_idle'] < time()) {
//destroy session if session time is less the what we have set the time
} else {
$_SESSION['timeout_idle'] = time() + MAX_IDLE_TIME; // if continue working on similar site then increase the time of script
}
}
?>

No comments:

security header validate

  HTTP Security Headers Check Tool - Security Headers Response (serpworx.com)