Skip to main content

Cookie-Based Authentication

Learn Cookie-Based Authentication (Cookies, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Fresher Notes Idea : after login the server sends a cookie holding a session id or token; the browser returns it on each request, and the server uses it to know who the user is. Session-based : the usual form is JSESSIONID ; the cookie holds only an id and the user data stays in HttpSession on the server. Flow : login with credentials, server checks them, creates a session, sends the cookie; later requests carry the cookie and are treated as logged in.

More lessons in Cookies