Skip to main content

HttpSession

Learn HttpSession (Servlet Integration, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Fresher Notes HttpSession stores per-user data across several requests, because HTTP itself is stateless. Session id : the container creates a session and sends its id in the JSESSIONID cookie; the browser returns it with every request. API : request.getSession() creates or returns the session, setAttribute and getAttribute store values, and invalidate() ends it (for example on logout).

More lessons in Servlet Integration