Jump to content

how does the user online status worK?


ted_chou12

Recommended Posts

Usually it's implemented like this:

User logs in and a timestamp is recorded.

On every page or refresh the timestamp is updated.

When polled for users online the script will query the user table for all timestamps between NOW() and NOW() - delta, where delta might be 10 - 15mins.

This gives you an estimates as to how many users might be online.  Obviously there are pitfalls.  Consider a user who signs on and then immediately signs off.  They will be counted as online for the next delta minutues.  Also consider the user who signs on and stays on one page for > delta minutes they will not be counted until they hit refresh or browse to another page.

Best,

Patrick

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.