Pergunta

If a user logs in to my page I use sessions. But when the user is on the page for shorter than 30 minutes the session gets removed. How can I make the period shorter to like one minute or something because the user is not always going to be on for so long.

Foi útil?

Solução

By default a session is kept active while it is requested at least every 24 minutes. The configuration directive session.gc_maxlifetime sets the idle time allowed between requests to keep the session active; by default the value is set to 1440 seconds (24 minutes). To alter this value, it can be used as well the function ini_set(), which must be invoked before session_start().

So, use ini_set() passing to it the number of seconds required.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top