Read from sessionStorage

Read from sessionStorage in JavaScript — with the four heights of help laid out: do it now, make it easier for the next person to accept, work out the right move when you are stuck, and learn the pattern so it stops coming back.

4prompt heights
Open it in the interactive atlas →

The four heights

The same task, four distances: today's deadline, the next reviewer, the stuck moment, the pattern.

Execute — do the immediate task

+
We need the checkout flow to persist choices for this browser session only. On page load, read…
We need the checkout flow to persist choices for this browser session only. On page load, read cartTemp from sessionStorage; if present, hydrate the cart state and mark the UI as ready. If not present, start with an empty cart. After any item add/remove or quantity change, write the updated cartTemp JSON back into sessionStorage.

Improve — make it easier to accept

+
Before I hand this to QA, make the session-cart obvious and auditable. Show a small Session cart…
Before I hand this to QA, make the session-cart obvious and auditable. Show a small Session cart indicator with the count and lastUpdated time. Make pricing changes reflect immediately and add a Clear session cart button that deletes cartTemp. Flag any edge cases where sessionStorage may be cleared unexpectedly (private mode, different tabs) so the reviewer understands limits.

Decide — diagnose the stuck moment

+
I tested the checkout across two tabs. I emptied the cart in tab A to complete purchase; tab B…

A user finished checkout in another tab and the cart vanished here

I tested the checkout across two tabs. I emptied the cart in tab A to complete purchase; tab B still showed items and the user tried to submit. On submit the app read sessionStorage and failed validation. I can't tell if tab B read stale sessionStorage or if writes weren't synchronized. What's the most likely diagnosis and the fastest fix to keep the UI consistent across tabs for this session-scoped cart?

Become — change the pattern

+
Over time we keep getting tickets where users expect their cart to persist across tabs or after a…

Session-only state confuses users who expect continuity across tabs

Over time we keep getting tickets where users expect their cart to persist across tabs or after a reload but sessionStorage clears. Our shortcuts to 'fix' it introduce race conditions. What's one change to our development habit and one small runtime pattern to reduce these session-store surprises and improve predictability for users?

Next to this one

Other programming language work people do in JavaScript.

Every task here came from the work, not from a feature list — which is why the prompts name what you want done and never the button that does it. The tool changes; the work does not.
Copyright © LLOS.ai · 2026 — original pedagogy, voice, and design — all rights reserved.

The rest of the map

Same library, five ways in.