Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is similar to the COMET/AJAX push model: http://en.wikipedia.org/wiki/Comet_(programming)

As HTTP is stateless it's hard to tell when a user has disconnected, you can make the count more accurate by starting a session for each user then incrementing a "last_connected" timestamp by N seconds for each hit (can you tie this to each COMET update? Perhaps with JS?), then expiring any sessions that haven't been updated for a while. This is how a few popular CMS' (Drupal, Joomla) implement the "Who's Online" count.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: