Question - What are the different methods involved in the process of session management in servlets?
Answer -
The different methods involved in the session management in servlets are as follows:
User Authentication
- A user tries to access a protected resource, such as a JSP page. If the user has been authenticated, the servlet container makes the resource available; otherwise, the user is asked for a username and password
HTML Hidden Field
Cookies
- A small text file created by a website that is stored in the user’s computer either temporarily for that session only or permanently on the hard disk. Cookies provide a way for the website to recognize you and keep track of your preferences
URL Rewriting
- URL rewriting is an automatic process of altering a program written for manipulating the parameters in a URL (Uniform Resource Locator). URL manipulation is employed as a convenience by a Web server administrator, or for nefarious purposes by a hacker.
Session Management API
- Session Management API is built on top of the Request-Response methods for session tracking. Session Tracking is a way to maintain state/data of a user. It is also known as session management in servlet.