Forum Moderators: coopster

Message Too Old, No Replies

best way to automatically log out after certain time

after last page request - not total session time

         

pixeltierra

9:50 am on Jul 12, 2006 (gmt 0)

10+ Year Member



What is the best practice for automatically logging out users after certain amount time after the last page request?

Is this a php job or a javascript job? It seems that javascript can't be relied on, and that php might have to store something in a database.

Perhaps the php version could use a $_session var. I could be reset every page request and compared. But then that wouldn't change the browser display. Maybe a mixture of php and javascript?

RonPK

12:48 pm on Jul 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can try to change the default session expiration time by using something like
ini_set('session.gc_maxlifetime', [i]#secs[/i]);

Documentation here [php.net]. Note that it may be wise to use a custom session storage path.

[edited by: coopster at 1:08 pm (utc) on July 12, 2006]
[edit reason]
[1][edit reason] fixed link [/edit]
[/edit][/1]