Web Storage Playground

Mr. Tono’s jar shelf is localStorage and each visitor’s tray is sessionStorage: save an object, a number or a token, see what the browser really keeps, then…

Why it matters

Misreading these stores breaks data quietly (an object becomes [object Object], a number becomes text), loses it when you do not expect (sessionStorage in a new tab), or lets others read it (a token in localStorage is read by any script on the page).

The key idea

Web Storage keeps text only, per origin, and sessionStorage per tab

Common mistakes

Try it in this playground