Originally Posted by Fumigator
Those sites are tricking you into thinking they are keeping close track but I assure you they are not. They are using a technique similar to the one I've described. You want to actively keep track of user's sessions and update a database field at a given moment in time when someone becomes idle but that's just wasted effort in my opinion-- you can achieve the same exact results by passively checking when the need arises.
Or, you can determine if he's idle by performing a timediff() on the last_activity column. At any moment you can decide if a user is idle. It's really the same thing, but this way you don't have to constantly update the database, you don't have the overhead of an Ajax call every 5 minutes, and it's one moving part you don't have to worry about it breaking.
Ok thankyou very much for you're time, much appreciated, i will look into this sometime later on.