Skip to content
StackDecode
System Design
8. Load Balancing and ScalabilityAnimated

Session Management

Tracking a user across requests.

The idea

Sessions use cookies and a server-side store or signed tokens.

Watch it work

Press play, pause, or step through. Some animations have settings you can change.

BrowserServerSession storePOST /login
  • current message
  • earlier
  • failure or attack

The user logs in.

step:
1/6
from:
Browser
to:
Server
1/6

Time runs downward. Solid arrows are requests, dashed arrows are replies.

Step by step

  1. 1User logs in
  2. 2Server creates a session
  3. 3Client sends a cookie
  4. 4Server looks up the session

Where it is used

Logged-in apps.

Watch out for

Session storage must be shared and secure.

Related