views:

63

answers:

1

Hi All,

Does any one know solution to tracking online users in Rails; when you have cookie based sessions? I am using Rails 2.3.5. If yes please let me know.

Thanks, Atul

+1  A: 

You haven't said how you're doing authentication, but I'm guessing that you have a controller that creates a session when a user logs in and destroys it when they log out again. You could have those actions also add and remove (respectively) a record from a database table to enable you to track each user.

John Topley
Hi John, Thanks for the reply. We are using Restful authentication. Well yes we can implement your solution; issue is sessions are cookie based so what if user does not logs out explicitly? we can write a work around for that as well i.e a default session expiry time for inactive users. But what I am looking for is a plugin which will do this in a more cleaner way. Is there any plugin for this? I Googled but couldnt find any. Please let me know if you know any plugin which can handle this.I am checking if restful-auth had this feature. Thanks in advance.Atul.
atul veer
@Autl Sorry, I'm not aware of any plugin that does this.
John Topley
Np, thanks for your help. Will update this thread once I find out a solution to this.Thanks,Atul
atul veer