Posted: Fri Feb 04, 2005 8:03 am
phpbb, for instance, calls the who's online control script on every page request made to it. It will only update the table every so often (default's a minute). I would imagine that they avoided using a Cron because a) they don't have much control over which server it's put on b) the who's online information is only useful to the users of the system.
Users are shown as online when they have been active in the last five minutes, by default. Their user will remain logged in for two hours (by default) after that, should they decide to come back. So yes, there can be some stale users in the list, however they aren't known to anyone but the server. Once their two hours is up, the server will remove their session from the list at the next page request. It's quite simple actually.
Running a Cron every second could also put undue stress on the system. And it's not particularly useful when no one's online.
Users are shown as online when they have been active in the last five minutes, by default. Their user will remain logged in for two hours (by default) after that, should they decide to come back. So yes, there can be some stale users in the list, however they aren't known to anyone but the server. Once their two hours is up, the server will remove their session from the list at the next page request. It's quite simple actually.
Running a Cron every second could also put undue stress on the system. And it's not particularly useful when no one's online.