tobimichigan Posted March 24, 2010 Share Posted March 24, 2010 Hello Gurus, Please could someone kindly point out what is really wrong here? [code<?php include('cnx.php'); //session_start(); $session_logout = $_SESSION['logintime'] + 30; if($_SESSION['logintime'] > $session_logout){ header("location:Expired.php"); }else{ $_SESSION['logintime'] = time(); } if(!session_is_registered(username)){ header("location:Not_Logged.php"); } ?> When I output $_SESSION[logintime], it reads 1269419494 for output which does not translate to a time() function. Hence even after the $session_logout = $_SESSION['logintime'] + 30; count expires the page is still open rather than auto logged out. Please can someone tell me what I am doing wrong? Quote Link to comment Share on other sites More sharing options...
slurpee Posted March 24, 2010 Share Posted March 24, 2010 1269419494 is definitely the correct return value from a time() function call. 1269419494 translates to Wednesday, March 24th 2010, 08:31:34 (GMT) What were you expecting the format of this value to be? Quote Link to comment Share on other sites More sharing options...
tobimichigan Posted March 24, 2010 Author Share Posted March 24, 2010 But this is not what I want it to do. Ok, let me rephrase, how do I make it auto log ot any user immediately after 5 mins? Quote Link to comment Share on other sites More sharing options...
slurpee Posted March 24, 2010 Share Posted March 24, 2010 This will have to be done with JavaScript. There's a discussion about this at: http://www.phpfreaks.com/forums/index.php?topic=261696.0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.