Free cheat sheet · Web auth
Stop storing tokens wrong.
If your auth token is in localStorage, one XSS bug lets an attacker copy it and sign in as your users. Here is where every token should live, plus the copy-paste config to put it there.
What's inside
- 01One table: what to store where (cookie vs memory vs localStorage)
- 02The 5 cookie settings that block token theft (HttpOnly, Secure, SameSite, __Host-, Max-Age)
- 03Copy-paste code for Express and Next.js
- 04The CSRF trade-off, explained, plus a 10-minute audit
By @afeez_sdbytes · SoftwareDevBytes × Global McLien Software Solutions.
Rather have it done for you?
Hand it to a senior team.
We review and fix auth in web and mobile apps: token storage, cookies, CSP and CSRF.
Free resources
More checklists from the team
Security · Free kit
Be Breach-Ready Kit
Free 3-page kit for founders and tech leads: monthly infrastructure checks, code review must-dos, team security habits and a plan for the first 60 minutes. Get the kit
Architecture · Free roadmap
System Design Roadmap
Free 3-page PDF: the 10 system design concepts to learn first, a 4-week plan, 2 practice systems (URL shortener, chat app) and a 6-step interview framework. Get the roadmap
Compliance · Free checklist