How can the session in servlet can be destroyed?



How can the session in servlet can be destroyed?..

Answer / Rahul Chauhan

A servlet session can be destroyed automatically when it becomes inactive (by configuring the timeout value) or explicitly by calling the invalidate() method on the HttpSession object. You can also use a listener to monitor sessions and manage their lifecycle based on application-specific rules.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Servlets Interview Questions

Tell the new features added in servletrequest interface i.e. Servlet 2.4

1 Answers  


What is URL Encoding?

1 Answers  


Can we get PrintWriter and ServletOutputStream both in a servlet?

1 Answers  


What is meant by servlet? What are the parameters of the service method?

1 Answers  


What is the major difference between servlet and applet?

1 Answers  


What is the use of httpservletrequestwrapper?

1 Answers  


What is SingleThreadModel interface?

1 Answers  


Explain the difference between get and post method in servlet?

1 Answers  


What is url encoding and url decoding

1 Answers  


What is MIME Type?

1 Answers  


Which event is fired at the time of session creation and destroy?

1 Answers  


Is servlet synchronized?

1 Answers  


Categories