Handling session time out & monitoring max inactive intervl in user session

This question may have been asked several times earlier.

Am unable to find resource where i get complete solution for

How user session is moitored using HttpSession listener . When it is timed out what event takes place.?

How to monitor inactive interval of user and invalidate his session.

I would highly appreciate for a step by step expalination .

Am using a servlet filter where user session is started but need to monitor it amongs varios pages user requests for.

Thanks.

[520 byte] By [princea] at [2007-11-27 9:04:44]
# 1
first, use a META tag for monitoring the max session inactive timeSee code below..<meta http-equiv="refresh" content="<%= session.getMaxInactiveInterval() %>;url=error.jsp">
vinayak_ra at 2007-7-12 21:38:09 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Thank you for the reply. I tried it your wayIt gives me error and do not take me to error page.I would appreciate if you can help me find some resource where i can find a step by step expalination .prince
princea at 2007-7-12 21:38:09 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
Hi everybody,Any one have better ideas please do respond.Your response is appreciatedThanks,
princea at 2007-7-12 21:38:09 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
> It gives me error and do not take me to error page.This should just work. Which error are you getting then?
BalusCa at 2007-7-12 21:38:09 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
Yep It did work I had the page configured wrongly and had to move the code bit up.Thanks.
princea at 2007-7-12 21:38:09 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6

Hi ,

I ran into another problem using the code below

<meta http-equiv="refresh" content="<%= session.getMaxInactiveInterval() %>;url=error.jsp">

When MaxInactiveInterval Period over the error.jsp page gets displayed . But then sessionListener notifies that session gets destroyed after another 10 minutes which is set in web.xml under <session-timeout> .

Is the reason for this is page refresh is an activity and container terminates the session after 10 mins.

If so how this can be resolved ?

Thanks

prince

princea at 2007-7-12 21:38:09 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7
Maybe you're overridding maxInactiveInterval manually using HttpSession#setMaxInactiveInterval()? If so, don't do that if you want to use the time-out as it is definied in the web.xml.
BalusCa at 2007-7-12 21:38:09 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 8

Yep It was there but i removed setMaxInactiveInterval() to avoid overriding the web.xml setting. Still the problem is there

Is it the "refresh" in meta tag which causes some page activity.As am noticing in HtpsessionListener the

sessionDestroyed(HttpSessionEvent arg0)method gets invoked 15 mins after the error.jsp is displayed .

I need this method be invoked immediately inorder to remove session objects from SessionMap in jsf.

Is there any other way i can acheive it.?

Thanks

princea at 2007-7-12 21:38:09 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...