PHP sessions - stuff to check when things goes wrong.
The probability that the problem you experiencing is the same is very low.
So here is what my little (and very annoying) google journey came up to:
- You must call session_start(); on each page
- If you use the header('Location: blabla'); you should use relative url to keep preserve session
- some people say before using the header action you need to call session_write_close(); - I'm not using it.
- session_write_close(); could be the reason to your problems, cause after calling it you can't modify the session (in the current http context), that was my problem.
- on php docs, they say that "Session ID is not passed with Location header even if session.use_trans_sid is enabled. It must by passed manually using SID constant."
Comments