JavaScript browser storage
JavaScript localStorage, cookies, IndexedDB, and browser persistence
Learn JavaScript browser storage with focused lessons on cookies, document.cookie, localStorage, sessionStorage, IndexedDB, JSON serialization, browser APIs, client-side persistence, and practical storage tradeoffs.
Browser storage lessons and concepts
Cookies and document.cookie
Understand browser cookies, document.cookie syntax, expiration, paths, and the limits of string-based cookie storage.
Outcome: Read and write small browser cookie values deliberately.
- JavaScript cookies
- document.cookie
- browser cookies
localStorage and sessionStorage
Use Web Storage APIs to keep simple string data across reloads or within one browser session.
Outcome: Persist lightweight client-side state without a backend.
- localStorage JavaScript
- sessionStorage
- Web Storage API
IndexedDB
Store larger structured browser data using IndexedDB transactions, object stores, indexes, and asynchronous APIs.
Outcome: Choose IndexedDB when localStorage is too small or too synchronous.
- IndexedDB JavaScript
- browser database
- client-side database
JSON serialization
Serialize arrays and objects before saving them in browser storage or sending them through network requests.
Outcome: Store and restore structured JavaScript values safely.
- JSON JavaScript
- JSON stringify
- JSON parse
Browser environment
Connect storage APIs with the browser runtime, window object, document, and web platform constraints.
Outcome: Understand where browser storage APIs live and how scripts access them.
- browser JavaScript
- window object
- browser APIs
Fetch and stored data
Combine network responses with storage by parsing API data and caching useful values in the browser.
Outcome: Move data between APIs, JSON, and client-side storage with clear boundaries.
- JavaScript fetch
- cache API data
- browser persistence