W3C home > Mailing lists > Public > www-jigsaw@w3.org > September to October 1998

Re: servlets and browsers

From: Yves Lafon <ylafon@w3.org>
Date: Tue, 27 Oct 1998 14:17:41 +0100 (MET)
To: Selma Harumi Takara <selma@nib.unicamp.br>
cc: www-jigsaw@w3.org
Message-ID: <Pine.GSO.4.05.9810271414350.19184-100000@tarantula.inria.fr>
On Tue, 27 Oct 1998, Selma Harumi Takara wrote:

> Hi,
> I'm developing a chat to be used for doctors using servlets, and 
> I have a problem: I need to be notified if the user closed the 
> window of the browser that is running the chat (trying to quit),
> and I'd like to know if someone have any suggestion, by the jigsaw
> or servlets.

Well, HTTP is stateless, it means that there is no notion of "session". Of
course, in the servlet API there is a way to do a session tracking, it
uses usually cookies or url rewriting (perfect for caches ;) ).
So you can't detect that someone closed its window unless the browser
enables you (via javascript or other things) to add a hook when the window
disappear. In that case, issue another HTTP request to the main server, to
notify the server the end of the session. Of course, if you want to be
bulletproof, use timeouts on the server side to avoid unset notifications,
like if the client reboot.

      /\          - Yves Lafon - World Wide Web Consortium - 
  /\ /  \        Architecture Domain - Jigsaw Activity Leader
 /  \    \/\    
/    \   /  \   http://www.w3.org/People/Lafon - ylafon@w3.org    
Received on Tuesday, 27 October 1998 08:17:58 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:25:33 UTC