On Thu, 9 Jan 2003, Wendy Cameron wrote:

> Date: Thu, 9 Jan 2003 13:28:35 +1000
> From: Wendy Cameron <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: Struts Users Mailing List <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
> Subject: RE: responding to session timeouts
>
> Can someone confirm that if you have an object that implements the
> HttpSessionBindingListener and you implement valueBound and valueUnbound
> if the user hangs up the browser, ie closes the window without loging
> off, when the session timesout, the session is invalidated and the
> valueUnbound is called?
>
> This has been bugging me, I havnt found confirmation of how
> HttpSessionBindingListener works in the case of a browser hang-up and
> find it difficult to test.
>

This works for Tomcat ... can't speak for any other container (although
the behavior is required by the servlet spec).

But, it is important to understand *when* this happens.  The timeout is
*not* based on the fact that the user closed their browser window or shut
down the browser entirely (the server has no clue that those events occur)
-- it is totally based on the "max inactive interval"  timeout that you
set for this session.  You set the default for your entire webapp with the
<session-config> element in web.xml, but you can change it on the fly for
individual sessions (for every request, if you wish), by calling
session.setMaxInactiveInterval().  To facilitate testing, you'll probably
want to set the session timeout very short in one of your test scripts so
that you don't have to wait forever.

> Regards Wendy

Craig


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to