I am using devise as a good way of authentication in my rails 3.2 application and I tried several ways to fetch online users ,I need to know if I can fetch all online users using sessions on my application
Asked
Active
Viewed 2,162 times
1
-
You mean currently logged in users? What have you tried so far? – simonmorley Jan 06 '13 at 01:38
-
I mean all online users on the site now ... – Remon Jan 06 '13 at 09:01
-
Forget about sessions. The best soluton is http://stackoverflow.com/a/21396780/5048945 Redis doesn't use your database. it fast and works fine. – mmike Mar 18 '16 at 13:03
1 Answers
1
Google and stackoverflow are your friends:
There appears to be a gem for this and has been asked a lot.

Community
- 1
- 1

simonmorley
- 2,810
- 4
- 30
- 61
-
these solution and other answers provided me to check if the user is online and was online since 1 min ago or more ,,but if the user close the browser or the session destroy the user is still online with all of these approaches – Remon Jan 06 '13 at 09:03
-
Your question is not clear. Perhaps consider being more descriptive to get better answers. That's probably why you got marked down. Moreover, I don't think finding your immediately connected users has anything to do with devise. Your app would need to poll them instead. – simonmorley Jan 06 '13 at 11:00
-
I think you are right ,,thanks for answering me ..I will find another solution ... – Remon Jan 06 '13 at 12:17
-
and you are right my question wasn't clear ,,I think it was better to ask ,,how can I implement online/offline feature like facebook ...and thanks again for your answers – Remon Jan 06 '13 at 12:27
-
In html5, btw, I think you can do something like if (navigator.onLine) {// Do something}. Although if you look through Google you'll find something better. S – simonmorley Jan 06 '13 at 12:42
-
@AndrewIce what a silly thing to say - if you feel an answer made over a year ago is out of date, don't mark it down, correct it or leave a constructive comment at least. – simonmorley Jul 13 '14 at 10:37
-
@simonmorley pretty sure I never marked it down. I simply commented on it. That would be rude to do. I also left constructive criticism, in my comment. Although apparently 'someone' deleted it. Since I remember specifically that I was mentioning about who the gem above was years out of date. Yeah, looking at my activity. I never earned a -1 for this post. – Andrew Ice Jul 17 '14 at 18:53