What are the different methods involved in the process of session management in servlets?



What are the different methods involved in the process of session management in servlets?..

Answer / Shahnawaz Ali

The following methods are involved in session management in Servlets:
1. setSession(HttpSession session): To create a new session.
2. getSession(): To retrieve an existing session for the current user.
3. getSession(boolean create): To retrieve or create a session if it doesn't exist.
4. invalidate(): To end the current session.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Servlets Interview Questions

How can we refresh automatically when new data has entered the database?

1 Answers  


what is servlet life cycle?

3 Answers   Inforica,


What is ServletContext object?

1 Answers  


how can we execute servelt? what the use ".war" or ".jar" file creation

3 Answers   CTS,


What is difference between get and post method?

1 Answers  


Explain web application directory arrangement?

1 Answers  


What is a java servlet?

1 Answers  


What are the different methods of session management in servlets?

1 Answers  


What is a web application and what is it’s directory structure?

1 Answers  


without session Id can we do any operations like add,update,edit,delete. I saw Session id is loaded for edit and delete action not for add .so am asking this

1 Answers   Syntel,


what is session tracking?what are types of session tracking ?and when to cookies,when to use sessionmanagement,whent use url rewriting technique,plz explain briefly?

6 Answers   Satyam, TCS,


Why don't we write a constructor in a servlet?

1 Answers  


Categories