bgsomers Posted July 29, 2006 Share Posted July 29, 2006 I run the following [code]session_start(); # create session to be resumed in file input.php$_SESSION["StartTime"] = time();# if(isset($_SESSION["StartTime"])) { echo 's'; }[/code]and the display alway contains a small 's', indicating that $_SESSION["StartTime"] has been stored.Later in the processing, I have [code]session_start(); # resume session created in file new.html$mintime = 15;$check = time();$duration = ($check - $_SESSION["StartTime"]);$admin01 = 'duration was: '.$duration;$admin02 = 'check time was: '.$check;$admin03 = 'start time if retrieved: '.$_SESSION;if (!empty($_SESSION)) { $admin04 = print_r($_SESSION,true); }else { $admin04 = 'the session variable $_SESSION has not been retrieved '; }[/code]Less than half the time, this leads to- duration was: 2- check time was: 1154188904- start time if retrieved: Array- Array( [StartTime] => 1154188902)indicating that $_SESSION["StartTime"] has been retrieved, and all is well.But more than half of the time, it leads to - duration was: 1154186069- check time was: 1154186069- start time if retrieved: Array- the session variable $_SESSION has not been retrievedindicating that the array element $_SESSION["StartTime"] was empty.How can this data be passed part of the time, but not all of the time?Bruce Link to comment https://forums.phpfreaks.com/topic/15971-session-management/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.