I’m running PHP on Windows/IIS.
My session variables don’t seem to be preserved from page-to-page.
This code…
//echos out the session variables in a nice format for inspection echo '<p><pre>'; print_r($_SESSION); echo '</pre></p>';
…outputs blank values, like this…
Array ( [s_firstvar] => [s_var2] => [s_third] => [s_numberfour] => [s_youget] => [s_thepoint] => [] => )
I found suggestions on a forum…
I had a similar problem recently (Win2000, IIS), and it turned out that PHP did not have write-access to whatever directory that the session data was stored in. You may want to look into this.
and
have you set session.save_path?
What’s the proper use of php.ini’s session.save_path? And, is that my problem?
Oops. I found that I was not using the correct syntax when assigning values:
Does not work:
Does work: