Cookies versus tokens: a paradoxical choice
summary
Compares concrete session patterns (server-state vs client-side JWTs), demonstrates broken code and fixes (shows a decode call that skips JWT signature verification and the correct verify flow), proves how an Angular interceptor token leakage leaks credentials to third parties, and evaluates storage tradeoffs with localStorage vs sessionStorage. Covers CSRF vs CORS/origin checks, cookie flags like SameSite/HttpOnly, session revocation limits, and when simple server sessions beat token-based schemes.
AI-written summary · about
chapters (13)
- 0:00Intro
- 0:35Session management
- 1:15Clientside sessions
- 3:10Session locality
- 5:40Geotokens
- 6:50Common mistakes
- 9:10Cookies
- 11:40Crosssite request forgery
- 13:05Crossorigin resource sharing
- 14:25Preventing crossorigin sharing
- 15:40Cookies are messy
- 18:35Summary
- 22:05Scenarios
related talks
40mTokens Instead of Cookies Thanks to JWT
26mThe Science of Authenticating Angular Apps
15mJWTs And Why They Suck
24mA Token Walks Into a SPA
26mSecuring Single Page Applications with Token Based Authentication
32mPortable Sessions with JSON Web Tokens
25mAuthstronomy: The Science of Authenticating Angular Apps
28mA Token Walks Into a SPA...
