You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by David Causse <dc...@cognitis.fr> on 2005/04/07 18:46:30 UTC
Unlimited session timeout
Hi,
I need in some exceptionnal condition to disable the session timeout for
one request.
Is there some convenient way to do so?
My idea is to do this but I'm unsure :
In the exceptionnal servlet (at the beginning):
session.setAttribute("OLD_TIMEOUT", new
Integer(session.getMaxInactiveInterval()));
session.setMaxInactiveInterval(-1);
In my filter:
Integer oldTimeout = (Integer) session.getAttribute("OLD_TIMEOUT");
if(oldTimeout != null) {
session.setMaxInactiveInterval(oldTimeout.intValue());
}
What do you think about this method is it safe/working?
Maybe there is a way to do it with session listeners (by cancelling the
call to invalidate, I don't know if it is possible).
Thank you.
David.
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org