FAQ #246: "Can I detect when a user leaves my site without pressing a logout button?"
A: Not really. The only thing you can do is keep track of which users/clients are requesting pages from your site. If they stop requesting pages for X minutes, it's safe to say that they are nolonger looking at your site.