Session Issue

Hi,

When I hit the IE browser back button I get “Webpage has expired error”. Any ideas how to fix this?


// this code at top of page...
<?php
session_start();
?>


// this code in body...
<?php
		 // check if session variable registered
  	 if (isset($HTTP_SESSION_VARS['valid_user']))
  	 {
  	    $username=$HTTP_SESSION_VARS['valid_user'];
echo '<p>You are logged in as: '.$HTTP_SESSION_VARS['valid_user'].'</p>';
session_register('valid_user');
				
echo '<p>Welcome</p>';				
								
		 }
?>

I haven’t encountered this problem, but a quick google search brings this up which seems to address the issue: http://shiflett.org/articles/how-to-avoid-page-has-expired-warnings

In any case, you should not be using session_register, as it is a deprecated function. $HTTP_SESSION_VARS is also deprecated – you should be using [URL=“http://uk2.php.net/manual/en/reserved.variables.session.php”]$_SESSION instead in both cases.