Can anyone tell why the following code:
<?php
session_start();
include "html.php";
include "./common_db.inc";
$time = $SESSION['Time'];
$user = $SESSION['User'];
$now = time();
echo "TIME1: $time<BR>NOW: $now";
if($now > ($time + 1200))
{
$query2 = "UPDATE users SET online = 'n' WHERE username = '$user'";
$result2 = mysql_query($query2);
session_destroy();
/ ?>
<script language=javascript>
window.parent.location.href = "index.php";
</script>
<? /
}
else
{
$now = time();
$SESSION['Time'] = $now;
$time = $SESSION['Time'];
echo "<BR>TIME2: $time";
}
?>
Would initally return:
TIME1: 1046151365
NOW: 1046151365
TIME2: 1046151365
And after refreshing the browser a couple of times it returns:
TIME1:
NOW: 1046151511
Warning: Session object destruction failed in c:\inetpub\wwwroot\dining\sess_mgmt.php on line 14
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in c:\inetpub\wwwroot\dining\inbox.php on line 47
Obviously the session variable isn't returning a value after refreshing the browser. but why would that be??!?!?!!? sorry i'm not too well versed in sessions and any help you can provide is definitely appreciated....