Store browser data without exposing sensitive information

8 steps · about 2 h 40 min · Intermediate

  1. 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.

  2. Recognize persistent script-readable storage (reference, MDN Web Docs, 20 min)

    Treat values available to every same-origin script as unsuitable for reusable secrets.

  3. Use tab-scoped state intentionally (reference, MDN Web Docs, 18 min)

    Understand which state ends with a tab and which risks persist across sessions.

  4. Account for partitioned browser state (guide, MDN Web Docs, 20 min)

    Understand how browsers isolate embedded storage to reduce cross-site tracking.

  5. Request persistence only when justified (reference, MDN Web Docs, 12 min)

    Treat durable local data as an explicit product decision, not a default assumption.

  6. 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.

  7. Review client-side storage hazards (guide, OWASP Cheat Sheet Series, 30 min)

    Apply defensive rules for local storage, messaging, workers and other browser features.

  8. Audit stored cookies in DevTools (guide, Chrome for Developers, 20 min)

    Verify actual attributes, scope and lifetime rather than relying only on application code.