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.

Consuming session APIs in a web app

Consuming session APIs in a web app

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

Start my 1-month free trial

Consuming session APIs in a web app

- [Woman] Okay, now let us just look at few important API's on the http session object. We have done session management with cookies, and you are rewriting, and every time you played with the http session API because that's like the hero of this entire process. Okay. So let's look at other few important API calls on that object. So what I've done is I've written a logout servlet and I've given it a url pattern of logout through the addition configuration. On line number 16 I'm just going to take the http session again. Right, so this is just an iteration of whatever we have explained ourselves before but there's often a confusion you're, whenever you say request or get session and as I said if the user is coming for the first time, this API call will return a new http session object, but if the same user comes again and again in the same servlet where you have invoked this API, it's basically going return the same session object item defined by the session ID that it is receiving from…

Contents