sandeepm Posted May 2, 2015 Share Posted May 2, 2015 i need logout code for apllication. This code is working properly but the issue is when the mouse moments on that browser it's not working can you tell me please.. $url = BASE_URL; $url1='home/logout'; $TimeOutMinutes = 5; // This is your TimeOut period in minutes $LogOff_URL = $url.''.$url1; // If timed out, it will be redirected to this page $TimeOutSeconds = $TimeOutMinutes * 60; // TimeOut in Seconds if (isset($_SESSION['SessionStartTime'])) { $InActiveTime = time() - $_SESSION['SessionStartTime']; if($InActiveTime >= $TimeOutSeconds) { echo "<script type='text/javascript'> window.onload = function () { top.location.href = '" . $LogOff_URL . "'; }; </script>"; } } $_SESSION['SessionStartTime'] = time(); Link to comment Share on other sites More sharing options...
davej Posted May 2, 2015 Share Posted May 2, 2015 See... http://www.w3schools.com/php/php_sessions.asp http://stackoverflow.com/questions/520237/how-do-i-expire-a-php-session-after-30-minutes Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now