

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Still calibrating
click for more info
Not enough gems
Cost: 6 gems
1: Authentication
incomplete
2: Stateless vs. Stateful Authentication
incomplete
3: What Are Sessions?
incomplete
4: What Are Cookies?
incomplete
5: Cookie Security
incomplete
6: Session Lifetime
incomplete
7: Password Resets
incomplete
8: Broken Password Reset Flow
incomplete
9: OAuth 2.0
incomplete
10: SAML and OIDC
incomplete
11: API Keys
incomplete
12: Reauthentication
incomplete
13: Authentication Misconceptions
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Whenever a web server receives a request, it first needs to answer:
Is this request coming from an authenticated user?
Requests typically carry proof-of-authentication through stateless tokens or stateful sessions.
Every request carries a credential that the server can validate without looking up a server-side session record. Typically:
Sure, the server may still load user data, but "stateless" means the actual token validation doesn't depend on any stored session state. Many stateless systems use bearer tokens encoded as JWTs, and anyone who gets ahold of one can use it until it expires.
To be fair, a JWT doesn't automatically make a system stateless, the server can still check it against stored state, but that sometimes defeats the purpose of it being a JWT in the first place.
The server remembers you. Typically:
Web apps usually carry the session identifier in a cookie.
Stateless token validation:
Stateful sessions: