Store browser data without exposing sensitive information
8 steps · about 2 h 40 min · Intermediate
- Design the cookie boundary (guide, IETF, 25 min)
Start with the protocol's scope, lifetime and script-access model for state sent with HTTP requests.
- Recognize persistent script-readable storage (reference, MDN Web Docs, 20 min)
Treat values available to every same-origin script as unsuitable for reusable secrets.
- Use tab-scoped state intentionally (reference, MDN Web Docs, 18 min)
Understand which state ends with a tab and which risks persist across sessions.
- Account for partitioned browser state (guide, MDN Web Docs, 20 min)
Understand how browsers isolate embedded storage to reduce cross-site tracking.
- Request persistence only when justified (reference, MDN Web Docs, 12 min)
Treat durable local data as an explicit product decision, not a default assumption.
- Clear origin data during sensitive transitions (reference, MDN Web Docs, 15 min)
Remove cookies, caches and storage when logout or account changes require a clean boundary.
- Review client-side storage hazards (guide, OWASP Cheat Sheet Series, 30 min)
Apply defensive rules for local storage, messaging, workers and other browser features.
- Audit stored cookies in DevTools (guide, Chrome for Developers, 20 min)
Verify actual attributes, scope and lifetime rather than relying only on application code.