How many ways to remove the session object in the container

Answer Posted / ravikiran

1).request.getSession().invalidate();
2).request.getSession.removeAttribute("obj");
3).Adding the following code inside the web.xml
<session-config>
<session-timeout>mins</session-timeout>
</session-config>
4).calling the seMaxInactiveInterval(seconds);

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the differences between jsp and servlet.

724


What is the disadvantage of cookies?

765


What is a cookie What is the difference between session and cookie

806


What is the procedure of invoking different servlet in a different application?

761


What is SingleThreadModel interface?

863


How can we achieve transport layer security for our web application?

774


What is servlet configuration?

753


What are all the protocols supported by httpservlet?

850


How can we implement a jsp page?

849


What is the difference between Servlet Request and Servlet Context when calling a Request Dispatcher?

824


How do you invoke a Servlet? What is the difference between doPost method and doGet method?

837


How many servlet objects are created?

769


How can I send user authentication information while making URL Connection?

732


Once the destroy() method is called by the container, will the servlet be immediately destroyed? What happens to the tasks(threads) that the servlet might be executing at that time?

983


What is meant by cookies?

826