I have encountered a weird situation:
First I assign variable to a session then I change it. Then the session changes when I change the variable, even when I didn't re-assign the value to the session :
the example (session1.php)
session_start();
$var_test = "first session value";
$_SESSION['var_test'] = $var_test;
echo "$_SESSION['var_test'];
// this will show "first session value"
the second php file (session2.php)
session_start();
$var_test = "second session value !!!";
echo $_SESSION['var_test'];
// this shows "second session value !!!";
In session1.php it shows "first session value" which is perfectly good, but in the second php file (session2.php) it shows "second session value".
Even though I didn't assign $_SESSION['var_test'] = $var_test, how come does it change automatically?
Is that a bug or is it just how it works?