PHP Session data not being saved

Thanks for all the helpful info. It turns out that my host changed servers and started using a different session save path other than /var/php_sessions which didn't exist anymore. A solution would have been to declare ini_set(' session.save_path','SOME WRITABLE PATH'); in all my script files but that would have been a pain. I talked with the host and they explicitly set the session path to a real path that did exist. Hope this helps anyone having session path troubles.


Check to make sure you are not mixing https:// with http://. Session variables do not flow between secure and insecure sessions.


Had same problem - what happened to me is our server admin changed the session.cookie_secure boolean to On, which means that cookies will only be sent over a secure connection. Since the cookie was not being found, php was creating a new session every time, thus session variables were not being seen.


Use phpinfo() and check the session.* settings.

Maybe the information is stored in cookies and your browser does not accept cookies, something like that.

Check that first and come back with the results.

You can also do a print_r($_SESSION); to have a dump of this variable and see the content....

Regarding your phpinfo(), is the session.save_path a valid one? Does your web server have write access to this directory?

Hope this helps.