How many ways to remove the session object in the container

Answer Posted / sekhar babu

To remove the session object .
1. with the help of web.xml
<session-timeout>time in minutes</session-timeout>
2. in programatically
session.setMaxInactiveInterval(time in seconds)

to terminate immediately the session
use session.invalidate()

Is This Answer Correct ?    23 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why jsp is better than servlet?

732


What’s the difference between forward() and sendredirect() methods?

770


What are the life-cycle methods for a servlet?

724


What is difference between cookies and httpsession?

769


What is the difference between Servlets and Applets?

745


What do you mean by the servlet chaining?

767


What is java servlet session?

711


What is a servlet engine?

736


How we can get ip address of client in servlet?

731


Can we refresh servlet in client and server side automatically?

778


When servlet is loaded?

784


Elucidate servlet attributes and its scope?

748


Difference between GET and POST?

890


What is the difference between the getrequestdispatcher(string path) method of javax.servlet.servletrequest interface and javax.servlet.servletcontext interface?

750


How to handle exceptions thrown by application with another servlet?

801