How to detect user inactivity

For questions and postings not covered by the other forums
allistar
Posts: 156
Joined: Fri Aug 14, 2009 11:02 am
Location: Mount Maunganui, Tauranga

How to detect user inactivity

Postby allistar » Mon Oct 19, 2009 8:46 am

Hi all,
We have had requests from our user base to provide the ability to automatically log a user out if their session has been inactive for a certain amount of time. Implementing the automatic log out itself is straight forward, but how would we detect inactivity generically?

I would consider "activity" to mean "interacting with any GUI controls either by using the mouse or the keyboard". We could code a "resetActivity" method on each event on each control type, but that would be quite expensive development-wise as well as unnecessarily increase the amount of traffic from the client to the app server. Another approach is to base it on database transactions which is much easier to detect generically, but that wouldn't help if a user is doing a lot of enquiring and no database updates.

Is there some generic Jade way or some other easy approach of detecting user inactivity?

User avatar
BeeJay
Posts: 312
Joined: Tue Jun 30, 2009 2:42 pm
Location: Christchurch, NZ

Re: How to detect user inactivity

Postby BeeJay » Mon Oct 19, 2009 8:59 am

There are two methods on application that can help you achieve this:

1. Application::setInactiveTimeoutPeriod

2. Application::inactiveTimeout

The 1st one sets how long you want the user to be inactive for before the system will fire the inactiveTimeout "event". The 2nd one you use to implement whatever is appropriate for your requirements when the timeout period has elapsed.

Cheers,
BeeJay.


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 10 guests