This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes question on destroying a session Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "question on destroying a session" Watch "question on destroying a session" New topic
Author

question on destroying a session

Karen Philip
Greenhorn

Joined: Jan 14, 2005
Posts: 20
Hello,

I was wondering if session.invalidate() is the only way to "destroy" a session.

Also, how can we figure out when the session was destroyed?

TIA


Thanks,<br />Karen<br /> <br />SCJP 1.4<br />SCMAD 1.0<br />SCWCD 1.4
Durgaprasad Guduguntla
Ranch Hand

Joined: Oct 20, 2003
Posts: 99
Other options are:

1. You can configure session-config element in web.xml by which the servlet container ends a session if a session is inactive for a specified time.

2.

You can also use the following method of HttpSession to programatically set the session time out period in "seconds".



You can implement HttpSessionListener to get the notification when the session is destroyed. It calls the method sessionDestroyed(HttpSessionEvent). This listener needs to be configured in DD.

Thanks,

Durga


Thanks,<br />Durgaprasad<br />SCJP1.4, SCWCD1.4, SCBCD1.3,<br />SCEA
 
Consider Paul's rocket mass heater.
 
subject: question on destroying a session