You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mississippi John Hurt <jo...@gmail.com> on 2006/08/20 03:09:13 UTC

Do Session Attributes get GC'ed After Session Times Out?

Hi,
Say I set some HttpSession attributes. If I set the timeout to 30 minutes,
and the user leaves for lunch and never comes back for 3 days, does the
session attributes get garbage collected?  Or do I have to explicitly
invalidate the session (ie when the user comes back say 3 days later and
hits the web page again), in order for his session attributes to get
"cleaned up"?  Thanks.

RE: Do Session Attributes get GC'ed After Session Times Out?

Posted by David Friedman <hu...@ix.netcom.com>.
The HTTP Servlet spec takes care of that.  You can even use listeners to
notify you when objects are being removed.  That way you can perform any
cleanup you require.  See:
http://tomcat.apache.org/tomcat-5.5-doc/servletapi/index.html

Specifically the HttpSessionBindingListener's description.

Regards,
David

-----Original Message-----
From: Mississippi John Hurt [mailto:johnhurt@gmail.com]
Sent: Saturday, August 19, 2006 9:09 PM
To: Struts Users Mailing List
Subject: Do Session Attributes get GC'ed After Session Times Out?


Hi,
Say I set some HttpSession attributes. If I set the timeout to 30 minutes,
and the user leaves for lunch and never comes back for 3 days, does the
session attributes get garbage collected?  Or do I have to explicitly
invalidate the session (ie when the user comes back say 3 days later and
hits the web page again), in order for his session attributes to get
"cleaned up"?  Thanks.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org