Re: Problem with $_SESSION
Without seeing your code and your PHP.ini settings, it is hard to know exactly what is causing the problem. But here are a few suggestions you may want to look into:
- Check that you are not overwriting the $_SESSION array or any of the variables in your session which you need.
- In the PHP.ini file, look for the session.savepath setting and change this to a different directory. When you navigate to your page, the session module should create a file which matches the session ID in this directory. Open this file in a text editor such as notepad and chack that it contains the data you expect it to after each page refresh and that the file doesn't get deleted un expectedly.
- The session module by default uses a cookie to keep track of the session ID for each user called PHPSESSID. Check that the cookie exists and check its parameters. I recommend you use Firefox for this as it gives you detailed information about the cookies, like when they expires, which domain they are valid for, which directory etc...
Its worth noting that if the page is located on a different domain or subdomain form the other pages the session module will not be able to read the cookie it. - Lastly, check the cookie parameters for the session module in the PHP.ini file. All the session settings are prefixed with session.* . Make sure that these are correct.
Re: Problem with $_SESSION
probably you forgot
start_session(); on every page that needs session.
Re: Problem with $_SESSION
Quote:
Originally Posted by snappel
Cookies are definitely enabled, $_SESSION is definitely being set, all pages have 'session_start();'
:wave:
Re: Problem with $_SESSION
Did you try what I suggested?
Re: Problem with $_SESSION
I tried the bits I could. I can't access PHP.ini because it's locked off (not my webserver). I moved the whole site to a different subdirectory and it worked fine. Strange...