Whats the difference between using invalidate() & sessionDestroyed for sessionclosing.

Showing Answers 1 - 1 of 1 Answers

devs

  • Feb 10th, 2006
 

session's invalidate method is used when the session will no longer exist or when for a particular client is leaving the session Eg:during the logout.

sessiondestroyed is a method of HttpSessionListener ,and this is called when the session is being removed.when the session expires or is invalidated the container first removes all of the session attributes, calls the HttpSessionListener's sessionDestroyed method and then sets the session to null so that it can be garbage collected.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions