Forum Moderators: coopster

Message Too Old, No Replies

How do I set an automatic session timeout?

Limiting session lifetimes for security

         

grahamstewart

10:39 pm on Apr 22, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




I'd like my users to be automatically logged out if they don't request a page for a certain amount of time (say 30 minutes).

Whats the most reliable way to achieve this?

I've messed around a bit with

session.cookie_lifetime, session.gc_maxlifetime and session.gc_probability
but I seem to get fairly mixed results.

Should I persist or is there a better way?

DrDoc

9:54 am on Apr 23, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, the three options you mention would work...
You can also explicitly call the garbage collect upon each new request... (or increase the probability)...

I'm afraid that I don't have any better advice to give you than what you've already tested.

Maybe Andreas has a better suggestion ;)