On 4/28/07, lightbulb432 <[EMAIL PROTECTED]> wrote:

Is it possible for a Tomcat session keep the session alive for a certain
period of time (say, 2 hours),

The session timeout interval is adjustable, see <session-config> under
conf/web.xml

Max inactive interval can also be specified in HttpSession object,
with setMaxInactiveInterval(int interval)

Additionally HttpSessionListener captures the event when the session
is about to be
invalidated -- according to JavaEE 5 API.

but remove all objects within it after a
default period of time (like half an hour)? This way the user doesn't have
to re-login as per your usual session timeout but their session state
doesn't eat up Tomcat memory.

I would consider setting a Cookie instead of storing login info in
HttpSession in this case.

One drawback with sessions is that, a session will not work if the web
page gets cached by the browser. So, in order to keep the session
alive, it is also important to prevent the caching of a page.

-Regards
Rashmi

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to