Practical guides

Test browser local storage and data export

A remembered preference or browser-held review log can help someone return to a task. Explain where the data stays, when it may disappear and how to recover it. Local storage should not be the only copy of important work.

Go to the method

Laptop, notebook, phone and mug on a desk
Illustration

Explain where data stays

localStorage retains data for an origin across sessions; sessionStorage belongs to a page session in a tab. An origin distinguishes protocol, host and port. Data stored on an HTTP version does not automatically appear on its HTTPS version.

The word ‘local’ does not guarantee encryption or isolation from scripts on the same origin. Describe the exact data retained and avoid storing secrets. On shared devices, provide a clearing action and explain its scope.

Plan for unavailable or lost storage

Browser settings, quotas, deliberate clearing and some private contexts can prevent retention or remove a copy. Rules vary by browser and API. A theoretical quota does not guarantee storage on a visitor’s device.

Handle read and write failures. If persistence fails, preserve active input where possible and clearly report that work remains usable in this page but persistent retention is unconfirmed. Do not announce ‘saved’ before an actual successful write.

Provide a documented export

For an important log or configuration, offer an export containing format, version, date and stable item identifiers. Recovery should not depend on the current visual order of rows. Avoid automatically collecting device details or unrelated information.

Requesting a download does not prove that the visitor kept the file. Phrase feedback accordingly and explain how to retain it. An export is not a secure sharing space: the person distributing it remains responsible for its contents.

Validate the whole import before applying it

Check size, format, version, types, expected fields, lengths, known identifiers and duplicates. Prepare the result in memory, then replace visible data after every check succeeds. A rejection must not leave half an imported log.

Display notes as text without interpreting HTML. Try an empty file, truncated JSON, an older format and strings containing special characters. When site changes alter an observation’s meaning, request a fresh review rather than automatically trusting a previous ‘passed’ result.

Test clearing and recovery

Check what each action clears: active input, one tool’s stored key or an entire account. Clearing one tool should not unnecessarily remove all site preferences. Previously downloaded exports remain independent copies.

This site’s budget and acceptance tools can be used without an account. The acceptance log exports to resume a review; directory selections retain browsing preferences when storage is available. Check each tool’s behaviour instead of assuming they all retain the same data.

Content updated on October 5, 2026

Acceptance matrix to adapt to your project

These proposed checks use synthetic cases. Decide the required behaviour with the team, record the result and assign unresolved gaps before release.

Test cases, expected outcomes and useful evidence
CaseExpected outcomeEvidence to retain
Browser refuses storageThe tool remains usable without promising persistenceInterface state after a failed write
Valid export and importIdentifiers, notes and statuses retain their relationshipsComparison before and after
Invalid or duplicate-item importEvery existing entry remains intactRejection feedback and initial values
Clear the logThe log resets; external exports remain independentInitial state and a new entry

Frequently asked questions

Is localStorage a backup?

It retains a copy in one browser for an origin. The user can clear it and storage may be unavailable. Important data requires an appropriate copy and recovery strategy.

Why does another browser not find my data?

Storage belongs to the browser, its profile and the site’s origin. Cross-device synchronisation needs a separate mechanism; localStorage does not provide it.

Can I import a file from elsewhere?

The tool must fully validate it and display text without executing it. Also check provenance and meaning: an old log does not establish the website’s current condition.