How many ways to remove the session object in the container

Answer Posted / amitasite

Programmatically:
1. session.invalidate()
2. session.setMaxInteractiveIntervals(0);

Container will remove session if user is idle more than the
time specified in <session-timeout>time in
minutes</session-timeout> in web.xml

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How we can call a jsp from the servlet?

712


What is the servletconfig object?

738


How do you load an image in a Servlet?

862


Which application server is best for java?

764


What mechanisms are used by a Servlet Container to maintain session information?

885


What are the phases of the servlet life cycle?

795


What is cookie? Why is cookie used?

793


When Servlet is unloaded?

834


Which protocol will be used by browser and servlet to communicate

761


What is servlet name in web xml?

754


What are the phases of a servlet life cycle?

833


What is the element?

772


Differentiate between get and post?

883


What’s the difference between sendredirect and forward methods

817


What is the use of attribute in servlets?

766