Nevermind. Ive fixed it.. On the particular include I was testing this on, there was also a hit counter.. n thats what was changing the value of $session somehow. As a matter of interest though, why would this happen? Heres the code on that include
<?php
echo ($session);
//update the counter
$ip = $_SERVER['REMOTE_ADDR'];
mysql_query("INSERT into hits values('NULL', '$PHP_SELF', '$ip', '$HTTP_REFERER')") or die(mysql_error());
//display the counter
$display = mysql_query("SELECT * from hits WHERE page = '$PHP_SELF'");
$row = mysql_num_rows($display);
echo ("<br><br>".$row."<br>Hits since Jan 2006");
mysql_close($connection);
?>
As far as I can see the hit counter should have no effect on the value of $session? But when I erased the counter the problem was fixed. =\