Maintain List of Active Users for Web

Posted by Bryan Marble on Stack Overflow See other posts from Stack Overflow or by Bryan Marble
Published on 2010-04-19T19:41:42Z Indexed on 2010/04/19 19:43 UTC
Read the original article Hit count: 350

Problem Statement - Would like to know if particular web app user is active (i.e. logged in and using site) and be able to query for list of active users or determine a user's activity status.

Constraints - Doesn't need to be exact (i.e. if a user was active within a certain timeframe, that's ok to say that they're active even if they've closed their browser).

I feel like there should be a design pattern for this type of problem but haven't been able to find anything here or elsewhere on the web.

Approaches I'm considering:

  1. Maintain a table that is updated any time a user performs an action (or some subset of actions). Would then query for users that have performed an action within some threshold of time.

  2. Try to monitor session information and maintain a table that lists logged in users and times out after a certain period of time.

  3. Some other more standard way of doing this?

How would you approach this problem (again, from a design pattern perspective)?

Thanks!

© Stack Overflow or respective owner

Related posts about web-applications

Related posts about active-users