users@glassfish.java.net

Re: Q: Can I define a Web Application with an indefinite session timeout in Glassfish 2.1?

From: Ed Hillmann <ed.hillmann_at_gmail.com>
Date: Thu, 10 Sep 2009 15:16:55 +1000

On Thu, Sep 10, 2009 at 12:25 PM, Jan Luehe <Jan.Luehe_at_sun.com> wrote:

> On 09/09/09 18:30, Ed Hillmann wrote:
> This should work.
>
> What do you mean by "My sessions are not kept at all"?
> Are you still seeing your sessions getting expired after 30 minutes?
>
> Thanks,
>
> Jan
>

I mean my sessions are not kept at all. The next time I do anything with
the loaded page, I get an error saying my session has timed out and I'm
redirected back to my Login page (as per my application's design).

Even better, my application is using ICEfaces, which performs an AJAX
heartbeat request back to the Web server. So, when I get to my login page,
after a second I get a popup notifying me that my session's timed out and
get redirected back to the login page (as per my application's design). I
imagine that the AJAX call is attempting to call back to its session (as it
should) which has been made invalid by the server.

So, when set to 0 or -1, it behaves quite the opposite to what is described
in the documentation.

I'm even more confused, as I'm even trying to set it programmatically via
HttpSession. According to it's javadoc,
I should be able to call
setMaxInactiveInterval<http://java.sun.com/javaee/5/docs/api/javax/servlet/http/HttpSession.html#setMaxInactiveInterval%28int%29>to
a negative value to define that sessions shouldn't time out. However,
even when I do that (and stop using either of the descriptors), it still
times out after 30 minutes.

I didn't think I needed to do anything else, but I'm happy to try something
else if it will do what it's supposed to do.

Thanks,
Ed