Getting Information about users viewing the page

Hi All,

I would like to implement a feature like,
I Would like to know which all users are currently viewing a page in my
Rails Application at any given instant.
I use Restful Authentication plugin for User Authentication.

Any Suggestions regarding how I can proceed on this ,would be really
helpful.

Thanks,
Charanya.

Since HTTP is stateless protocol you haven’t such opportunity.
But of course there are some ways to emulate such things.

Here are the brief review for some of them:

  • you may check the time of last viewed page for authenticated users
    e.g. everyone who visited the site within 5 minutes is online.
  • with the same approach you may try to track non-authenticated users
    by their IP addresses (but don’t forget to take care of all related
    stuff in this case, like removing expired visit records from your DB )
  • also you may try to add some AJAX script which will pull the server
    each 3 minutes from browser, which give you to know that user is
    online but just viewing the same page…

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs