I'm experiencing a strange PHP session issue. Can someone tell me if that's how session works?
To see the problem, load the following code into any php file, say test.php, and run it 2 times. NOTE, you have to run it two times, i.e. load the page and reload it.
<?
session_start();
$_SESSION["test"] = "Original////";
$test=$_SESSION["test"];
echo $_SESSION["test"];
$test="New////";
echo $_SESSION["test"];
?>
On my server, the first time I load this test page, I get
Original////Original////
and that is correct. But when I reload it, I get
Original////New////
which means the 5th line "$test="New////";" actually rewrite my $_SESSION["test"]. That doesn't make sense to me. Anyone knows what is happening? Or it's just happening on my server???