Hi All-
A site I am working with has been, apparently, hopping PHP sessions, and I don't see how nor how to rectify it. I say "Session" but that might misleading.. Specifically, the $_COOKIE superglobal is not reliably referring to the same user it's supposed to!
One simple method to demonstrate it:
<?php print $_COOKIE['UserName']; ?>
This should print the browser cookie value "UserName" under this site's domain, right? And so it would stand to reason that if UserName is cleared out locally, that a refresh of that page should also be blank, right? (and possibly even issue a PHP Undefined Index Notice) And in no case should the value shown be something from some random user that has never been on my computer, right??
Here's a clue or a fish: It *seems* that refreshing the browser reliably returns that same wrong cookie value for a long time, but another browser experiencing the same issue may have a different wrong name (reliably with each refresh).
Note: The site is behind a load balancer, but there is only 1 Apache/PHP server.
Any thoughts on what makes PHP session's superglobals tick, how this "session hopping" is possible and how to fix it? I've never seen/noticed something like this before.
Thanks?
-Bronius