Reputation: 2943
It took me a while to realize that $_SESSION['user'] was changing because I have a variable set: $user = array();
Is this normal? I haven't had this issue until today, not sure if it is a server/php setting
Upvotes: 1
Views: 129
Reputation: 19970
Depends on how you set $_SESSION['user'].
If you are setting it by reference then it is tied to the variable you used to set it.
ie.
$_SESSION['user'] =& $user;
$user = array();
now $_SESSION['user'] is an empty array
Upvotes: 0