Preparing your workspace
HTTP is generally stateless, so applications use mechanisms such as cookies and server-side sessions to remember users between requests.
A browser may store cookies associated with a website and automatically send eligible cookies with later requests. Applications can use cookies for preferences, session identifiers, and other purposes. A session can be maintained by storing a session identifier in a cookie while the server keeps the related state. Secure applications must carefully configure cookie attributes and avoid storing unnecessary sensitive information in browser-accessible locations.
After logging in, a browser may receive a secure session cookie so later requests can be associated with the authenticated user.
Browser ↓ Request + Cookie Server ↓ Looks up session Authenticated User ↓ Response + Set-Cookie when needed
The browser and server use cookies and session state to maintain continuity between requests.