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. Regards, Pavan --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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. Robin On Feb 14, 3:42 am, "Pavan Agrawal @ Rails" <pavan.agraw...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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. > > Regards, > Pavan--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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. F --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---