File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "question on destroying a session" Watch "question on destroying a session" New topic

question on destroying a session

Karen Philip

Joined: Jan 14, 2005
Posts: 20

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?


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.


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,<br />Durgaprasad<br />SCJP1.4, SCWCD1.4, SCBCD1.3,<br />SCEA
I agree. Here's the link:
subject: question on destroying a session
It's not a secret anymore!