That was a solution that come in my mind also.
But, I don't think you need to build you're own time-out mechanism.
There already one in place.
If you register a SessionBinding listener, you can be notified on
valueUnbound when the session has expire.
I do some testing with the default value for session timeout ( which I think
is 30 sec.) and is working pretty good.
You can modify this value from tomcat setting or from you're code.

BTW, HttpSession has a method named  setMaxInactiveInterval which take as
input a int value.
The problem were is that his method is obsolete, and I think I read some
ware that it doesn't have a replacement...right?

Alin



----- Original Message -----
From: "Devon Ziegler" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 21, 2001 9:02 AM
Subject: RE: Browser Closed


> I ran into a similar problem.  The servlet sessions will timeout so the
user
> has to log in again, but that doesn't help with what you are talking about
> (which seems to be cleaning up things after a user has been inactive long
> enough).
>
> I basically created a context wide vector of user "sessions" (my own
notion
> of a session, not servlet's) that had inside it the last time a request
was
> received by that user.  Upon any request I update the list for the current
> request (setting the time of last request to now) and clean up any
> "sessions" that have gone beyond my timeout period (which is slightly
longer
> than my servlet session timeout period to be safe).  Admittedly this
cleanup
> will only happen if a request occurs after the user has been inactive long
> enough, but, for me, that was acceptable.
>
> HTH.  -Devon
>
>
>
> -----Original Message-----
> From: Alin Simionoiu [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, May 17, 2001 12:18 AM
> To: [EMAIL PROTECTED]
> Subject: Browser Closed
>
>
> Hello everybody,
>
> I'm implementing a login/logout from a web page.
> Everithing is absolutly fine if the user it's using my logout button.
>
> But, if the user just close the browser, without using the logout button,
> then I'm in trouble.
> Has anybody any ideea if is possible to know when a user close the
> browser?..
>
> I'm not using a keep-alive connection.
> Probably is not possible, considering that http is a stateless protocol.
>
> Alin
>

Reply via email to