PDA

View Full Version : Destroy Session if user activity is idle...


Yakisoba
06-06-2006, 08:40 AM
... for X amount of time.

Seaching the forum I came accross this thread:
http://www.codingforums.com/showthread.php?t=85400&highlight=session+idle

Although it was helpful, my situation/problem is a little different.

I would like the session to be destroyed if the user has not interacted with the page after "X" amount of time...

The user will spend the majority of thier time on one particular page...they will rarley need to navigate to different webpages...

so, if the user is on "somePage.html" that has text boxes, text areas, etc. and does not click or type on the page for more that 5 min the session should be destroyed.

Is this possible?
Any suggestions on how to accomplish this?

Thanks,

Yakisoba

w3bs-otsu
06-06-2006, 12:47 PM
If they arent moving from the page - php may not be the key as a page needs to reload for a php script to DO something, this may be possible:

<META HTTP-EQUIV="refresh"
content="300;URL=http://www.yourdomain.com/timout.php">

At the top of your page to refresh the page to another page after 5 minutes

DOWNSIDE: Not all browsers support this