session_cache_expire


#1

I have this in my header script:

[php]
session_cache_expire (240);
session_start();
[/php]

It is at the very top and no errors are reported when it is called. The problem is that it doesn’t seem to work. It still times out at 30 min vice 4 hours. Anyone know what could cause this?

Bobby


#2

Ok, if you are sure that script is fine (All page) then check PHP.ini file

There are 2 lines that might have affect:

session.gc_maxlifetime = 1444 //
Garbage Life time, if cookie is considered as g and will be rebuved by g collectors

session.cookie_lifetime = 0 //
Regular lifetime, if 0 then till the browser restarts


#3

There should be an other option to set the session’s cookie length.


#4

Do you know what the other option could be. Here is what we changed the php.ini file to read:
session.gc_maxlifetime 18000
session.cookie_lifetime 0


#5

0 should be infinite, which is probably not what you want.


#6

According to manual, session.cookie_lifetime 0 mean that if your browser was closed your session is destroyed

0 is not an infinity in this case


#7

Going by those settings it should work, But it is still timming out within a half an hour.


#8

Whats your server OS and webserver?


#9

Linux and Apache.

Thanks for any help.


#10

I don’t know linux, check maybe there are some permissions in OS that store session data seperatly? Like on windows Machine_IUSER remote access session setings.