Users on my website can have friends, and friends can chat with each other. You can also set your status to online, away and busy.
If a user is no longer on the website, his status should be set to offline. I guess the best way to do this would be to send AJAX requests to the server at a regular interval, then automatically set the status to offline if the server stops receiving these messages.
However, what would be a good interval to send these messages? 5 seconds? 1 minute?
If it really depends on how capable the webserver is, is there a way to check with PHP? What would be example intervals for some frequently-used webserver capabilities?