From the course: Java EE: Servlets and JavaServer Pages (JSP)

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Understanding the need for session management

Understanding the need for session management

From the course: Java EE: Servlets and JavaServer Pages (JSP)

Start my 1-month free trial

Understanding the need for session management

- [Instructor] Now let us understand what is session management, but before that we need to understand an HTTP limitation, because of which we need session management. All the requests that happen from the client to the server go over the HTTP protocol. Unfortunately HTTP is a stateless protocol, as in it does not conserve the state of conversation between the client and the server. Let's take a look at this diagram. When a client or a user comes with a request of adding an item to cart in a shopping application it goes to the server. The server is going to add item to the cart and then responds back to the client with an appropriate message. After this the server forgets this user. So if the same users comes over again and adds another item to the cart the server is going to treat it as a new user. If the same user comes over and over in all these cases the server would treat it as a new user. This is not a very good situation, because imagine your sense on a shopping cart…

Contents