tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Russell Gold <>
Subject Re: how to detect a session has no user
Date Sun, 24 Sep 2000 14:13:07 GMT
At 4:29 PM -0400 9/24/00, Mark Lintner wrote:
> I list logged in users in a db table. When they log off they are removed.
> How can  I detect the case where they have closed the browser without logging
> off so that  I can remove them from the db??

There is no way to detect the closing of a browser, since it only contacts the server when
the user asks it to. Without some complex keep-alive applet, your best bet is the standard
session timeout: if a user does not make a server request for some period of time, just declare
the session invalid.

Russell Gold                     | "... society is tradition and order    (preferred)  | and reverence, not a series of cheap              | bargains between selfish interests."       |   - Poul Anderson, "Iron"

View raw message