문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top