I am using sessions for my admin part of the website and it seems to time out around 20 mins or something, and I have to re-login. Is there a way to make the session last longer?
how to make sessions last longer?
Um... sessions don't have timeouts as far as I know, except unless you close your browser. Cookies have a length though....
You might try increasing the session_cache_expire() time from 180....
I am having the same problem. If I refresh a page after about 20 minutes of inactivity, I have to log in again. I checked the settings for the session.cache_expire using the phpinfo() function, and it is set to 180. According to the PHP manual, this setting is in minutes, so this value is equal to 3 hours.
Could be a browser setting
It's not likely to be a browser setting. We have sites on two different servers, both with Apache/MySQL/PHP. On one, we get the timeoput after 20 or mins, but we don't experience this on the other one. The only time that the browser settings come into play is if cookies are disabled, and then you can't log in at all.
Well, session dont' have time-outs. So unless your using sessions as cookies, they won't timeout. The cache was just a guess.
If you read up on sessions, it has a length of as long as the browser is open. So it's either a browser issue, or a PHP setup issue so perhaps it's defaulting sessions to cookies and you just don't know.