Backend Fundamentals · Who are you, and what may you do?
Sessions and cookies
HTTP forgets you after every request. A session cookie carries only a random id; the server keeps the real state in a store and can delete it at any moment.
- Time22 min
- LevelDeveloper
- Experiments1 live
- Check6 questions






Browser posts email and password to
Server checks the password, then creates a fresh random session id.
Session store saves the id with user 42 and a 30-minute expiry.
Next request the browser sends the cookie; the server looks up the id.
SameSite other sites making the browser send it on their requests.
__Host- prefix, no Domain subdomains receiving or overwriting it.
Server-side timeouts an old stolen copy working forever.