Local storage
Local storage is a browser-provided, origin-scoped key-value storage mechanism that persistently stores string values across sessions.
Web Components in Action
Local storage is a browser-provided, origin-scoped key-value storage mechanism whose values are strings and can persist across browser sessions.
- How it is used
- Persists an editable workout plan so the application can reload a previously saved routine after the browser closes.
- How deep it goes
- Demonstrates string storage, origin-scoped keys, JSON serialization, enumeration, saving, loading, and clearing.
- Examples
- Uses string key-value snippets and a workout planner that saves, loads, lists, edits, and clears personal routines.
- What you can do after
- Operate local storage through setItem, getItem, Object.keys, JSON.stringify, and JSON.parse.
React Hooks in Action: With Suspense and Concurrent Mode
Local storage is a browser-provided key-value storage mechanism that persists string data across page visits.
- How it is used
- Persists a selected user so a page can restore the choice after revisits or refreshes.
- How deep it goes
- Demonstrates reading and writing values through effects, including mount-only and state-dependent dependency behavior.
- Examples
- Uses a user-selection dropdown whose saved choice is restored after refreshing the page.
- What you can do after
- Builds a React user picker that restores and persists its selected value with local storage.
Read how React Hooks in Action: With Suspense and Concurrent Mode explains local storage →
Related concepts
- cookiealternative to · An HTTP cookie is a small piece of data that a server asks a user agent to store and return with subsequent requests within its scope.
- browser developer toolsused by · A suite of browser-integrated utilities for inspecting, debugging, testing, profiling, and analyzing web pages, applications, and browser-executed code.
- notificationused by · A notification is a message or signal delivered to one or more recipients to communicate an event, change, status, condition, alert, or requested action.
- useEffectused by · useEffect is a React Hook that runs effect logic after rendering to synchronize a component with external systems and optionally perform cleanup.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

