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? Link to comment https://forums.phpfreaks.com/topic/196331-_sessionlogintimetime-problem/ 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? Link to comment https://forums.phpfreaks.com/topic/196331-_sessionlogintimetime-problem/#findComment-1030937 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? Link to comment https://forums.phpfreaks.com/topic/196331-_sessionlogintimetime-problem/#findComment-1030938 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 Link to comment https://forums.phpfreaks.com/topic/196331-_sessionlogintimetime-problem/#findComment-1030941 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.