Free course

Browser Storage Course

Build reliable browser state with cookies, Web Storage, IndexedDB, Cache Storage, quotas, persistence, and origin-private files.

5 modules · 25 lessons · No signup

Prerequisites: HTML, JavaScript and HTTP

~~~

Your progress

of lessons completed.

Course completed.

What you'll learn

Build and test a local-first field-notes app with deliberate storage ownership, safe upgrades, offline resources, export, cleanup, and recovery.

Take this course offline

Subscribe to my newsletter to get every free book and course in PDF and EPUB format.

Get the downloads

Course contents

  1. Choose and observe storage

    Map each value’s owner and lifetime, understand browser boundaries, and inspect existing state.

    1. Follow one piece of data
    2. Understand origin and site boundaries
    3. Choose storage from the job
    4. Inspect before you change
    5. Check your understanding: choose and observe storage
  2. Cookies over HTTP

    Trace cookie transport, scope values narrowly, secure sessions, and handle partitioned state.

    1. Follow the cookie round trip
    2. Control cookie scope and lifetime
    3. Lock down a session cookie
    4. Handle cross-site and partitioned cookies
    5. Check your understanding: cookies over http
  3. Web Storage

    Use localStorage and sessionStorage for small values, then handle invalid data and tab conflicts.

    1. Save a small preference
    2. Keep a draft in one tab
    3. Version and validate stored JSON
    4. Coordinate tabs and handle failures
    5. Check your understanding: web storage
  4. IndexedDB

    Store structured notes with keys, indexes, transactions, and versioned schema upgrades.

    1. Open a notes database
    2. Write and read structured notes
    3. Query notes through an index
    4. Use transactions and unblock upgrades
    5. Check your understanding: indexeddb
  5. Offline files and durability

    Cache responses, measure quota, request persistence, store files, and design recovery.

    1. Cache request and response pairs
    2. Measure quota and request persistence
    3. Store an attachment in OPFS
    4. Finish the storage recovery plan
    5. Check your understanding: offline files and durability