I have a problem with session_start() . It creates a new session every time the page is refreshed / loaded.
here is the code:
<?php $bob = session_id(); echo "Session ID on load is ".$bob; echo "<br>"; if($bob==""){ session_start(); $bob = session_id(); echo ' session ID currently is '.$bob; }
When I load the page, I get the following:
Session identifier when loading the current session identifier ed320bc5e24c871c9db8ea30e6796c14 (or option)
if I refresh the page I get:
Session identifier when loading the current session identifier fbd69d01d511a7be382799dca7279a86 (or variant)
the session id is always empty before session_start() is called, and it is always the new session_id()
It does this in all browsers, and I checked to make sure cookies are enabled.
The session save path is specified as /tmp . I donβt know exactly where it is, but looking at my root and all the other directories, I canβt find the session file (assuming that it will look something like sess_fbd69d01d511a7be382799dca7279a86).
So, I think something is happening with the save loop, but I'm too new to this to know for sure, and server administrators are pretty useless. What should be my next steps in diagnosing the problem? The server is running 5.3.22.
phpinfo here
Thanks for any help.
ps you can visit pcm.pcmxa.com to see the problem yourself if you want.
source share