Secure cookies and session handling for web logins
8 steps · about 2 h 55 min · Intermediate
- Using HTTP cookies (doc, MDN Web Docs, 25 min)
Start with how Set-Cookie and Cookie headers work, and how session and permanent cookies differ.
- Secure cookie configuration (guide, MDN Web Docs, 15 min)
This is the authoritative short guide to the __Host- and __Secure- prefixes, HttpOnly and SameSite.
- Cookie Security Flags: How to Secure Cookies with HttpOnly, Secure, and SameSite (article, Acunetix, 15 min)
It shows each flag next to the attack it blocks (XSS, interception, CSRF), with Express and Python code.
- Cookie Security: HttpOnly, SameSite, and Secure Flags (guide, How HTTP Works, 15 min)
It compares full Set-Cookie examples, such as a short-lived banking cookie versus a longer app cookie.
- Secure, HttpOnly, SameSite, the cookie security attributes (reference, CentralCSP, 15 min)
It combines all the attributes into one recommended session cookie and covers browser support and Strict vs Lax.
- Session management: cookies, tokens, timeouts, and revocation (guide, identitysecurity.tech, 25 min)
It follows a session from login through rotation to revocation, so you see where the cookie fits in the whole lifecycle.
- Session Management Cheat Sheet (reference, OWASP Cheat Sheet Series, 45 min)
This is the industry checklist for session ID entropy, regeneration after login, expiry, and keeping tokens out of web storage.
- Session Management (reference, NIST SP 800-63B-4, 20 min)
It gives the formal standard for session secrets, idle and absolute timeouts, and logout.