Page 1 of 1

Session Time not updating

Posted: Fri Mar 23, 2007 6:12 pm
by tecktalkcm0391
I have the following code, and it's not updating the session_time every time your refresh the page... its on required by header.php which is auto-appended.... i did an print_r and loggedin is there, but the time doesn't update

Code: Select all

if(isset($_SESSION['loggedin'])){
	if(isset($_SESSION['session_time'])){
		unset($_SESSION['session_time']);
		$_SESSION['session_time'] = time();	
	} else {
		$_SESSION['session_time'] = time();
	}
}

Posted: Fri Mar 23, 2007 7:33 pm
by John Cartwright
was session_start() called prior to this code running?

Posted: Sat Mar 24, 2007 10:32 am
by tecktalkcm0391
that was it! Thanks! I included the session.php page before that