over 9 years ago
Hello Reader's, If you want to set session time out for fix time period in PHP use the below code.
$page = $_SERVER['PHP_SELF']; $sec = "1"; header("Refresh: $sec; url=$page"); session_start(); $now = time(); if(!isset($_SESSION['start'])) { $_SESSION['start'] = time(); // taking now page start time } $_SESSION['expire'] = $_SESSION['start'] + (1 * 60) ; // ending a session in 30 $outOfTime = $_SESSION['expire'] - $now; //print_r($_SESSION); echo $outOfTime; if($outOfTime<=0) { header("Location:http://www.google.com"); session_destroy(); }
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
Sign up using
0 Comment(s)