How to check the live users

Hi All,
         Since few days I stuck in a question that how to find logged
in users of my application. I am using db session store. can any buddy
help for this.

Thanks a lot in advance.


I would use a before_filter on any action that a user might take which
updates a timestamp field in a separate model. Then, to find out who
is online, you could search that model for rows that have updated in
the last few minutes.


The web uses a connectionless protocol and you cannot force people to
log out. They can just disconnect. You could record the time of
login and logout but that wouldn't be quite right, because you can't
distinguish between someone has shutting down their machine and going
away from them having a momentary disconnect.

You could expire their session (their login) if X minutes elapsed and
they didn't do anything. But then you'd have to record the time in
the database each time they did something.