redirecting to login page after 12 minutes inactivity

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
amitsri
Forum Newbie
Posts: 14
Joined: Fri Aug 18, 2006 6:16 am

redirecting to login page after 12 minutes inactivity

Post by amitsri »

hi

i am trying to implement a code which will logout a logged in person after 12 min of inactivity. is there a way out to solve this problem. thanks in advance.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post by Christopher »

You could use a Meta Refresh tag in the head or use the Javascript setTimeout() function.
(#10850)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

The more effective way is using the session system. Specifically, implementing database sessions. We've talked about this sort of behaviour a lot. Several times quite recently. So if you want more detail, seek them out. The summary is: your record the last request time and delete those in the table that are stale.
Post Reply