Forum Moderators: coopster
session_start in the correct place? Try a little test script on the server to see if it truly is due to settings and not the script itself.
if (empty($_SESSION)) { session_start(); }
Well, I believe this won't work as you might expect, because you aren't initiated the session before you check to see if the $_SESSION global exists. Try taking it out of the conditional to see what happens:
#if (empty($_SESSION)) {
session_start(); #just having this on the top
#}
[edit]
nvm...what you have should work :)...i guess it's worth a try to do the above. Definitely try the small example with another script.
[/edit]
[edit2]
I've just tried a small test to see a couple things. The behavior that you are getting is strange from what you are telling me. Everything you have should work as expected.
[/edit2]
Sometimes i got around it by addind the following line right below the session_start()
header("Cache-control: private");
Other times i just incerase the session timeout by using
session_cache_limiter();
session_cache_expire();
session_save_path();
ini_set('session.gc_maxlifetime',18000);
Hope those will help you.
PS: haven't figure the why session is timing out.... i am just happy i get around it
You can get around this problem by storing your session data in a temporary directory within your web space.