Many personals sites (nerve, OKCupid, etc) and message boards (including this one) have a “this user is currently online” indicator. Does this simply mean “this user has accessed this site in the past N minutes”, or do they use a more intrusive method to determine whether the user has left the site (to look at another site, or closed the browser)?
I believe most of them simply list who is currently logged in to the site.
But people don’t usually click on “Log Out” when they’re done with a particular site. They’d just close the browser, or move on to another site. Does the server know when this happens? How? I didn’t think plain HTML could do this.
They probably use per-page cookies that are set to expire pretty quickly after you visit. So as long as you keep loading pages, you’ll be marked as there, but soon after you leave, you won’t.
HTTP (the interface between your computer’s browser and a Web server) isn’t a steady connection. Each time you request a file from the server, the connection is established, the file (Web page, image, whatever) is loaded, and the connection is closed. The only way they can do a “who’s online now” list is by using a timer.
NOTE: This does not apply to other kinds of Internet connections, like those that a Java client may establish with its server. Ditto IRC, FTP, streaming media, and lots of other examples.
Thanks, that’s what I suspected.
I guess my followup question is: do some of the sites I mentioned use non-HTTP methods to determine whether the user is “online”? Personals sites in particular have chat/IM, so does that imply they can (and do) push/pull info to/from the user’s PC at will? (I haven’t actually used IM on those sites so I’m not too sure how they work.)
The statelessness of pure HTTP is kind of a red herring here, as any cookie-enabled web site maintains as much statefulness as most other TCP- or UDP-based protocols.
Also, it is not tremendously difficult to develop a web site that aggressively tracks the time you “linger” on any given page – many advertising engines these days supply client-side code (JavaScript) that prompts your browser to periodically (say, every 30-60 second) request some invisible piece of content from the server in a hidden IFrame or ILayer. Thus, technically, the server does not know whether you’re on the site until you visit a page, but you oblige it by (unknowingly) making a large number of small visits.
I don’t think any of the sites mentioned in the OP would bother doing this, since it does entail eating a lot of log-processing overhead on the server (and for a pretty negligible gain, it would seem – how much do I really care whether you left the browser window open for 30 seconds or 3 hours?). It’s mostly useful for advertisement tracking.