How the web works · Comparison
Cookies vs localStorage vs IndexedDB
Three ways a website can keep data in the visitor's browser. They differ in size, in whether the data travels to the server, and in who can read it.
3 options · 8 questions side by side · updated
The options
- CookiesSmall pieces of data a website asks the browser to keep and send back with every request, mostly used to keep people signed in and remember their choices.
- localStorage and sessionStorageSimple built-in browser storage where a site can save small pieces of text, such as a theme choice or a half-written draft, that survive a page reload.
- IndexedDBDatabases and storageA database built into every modern browser, so a web app can keep large amounts of structured data on the visitor's device and work offline.
More comparisons
- Domain vs DNS vs hostingThree things people often buy from one company and so assume are one thing. The domain is the name, DNS is the signpost from the name to a server, and hosting is the server itself.
- TCP vs UDPThe internet's two transport protocols. TCP guarantees that data arrives complete and in order; UDP just sends packets and moves on, which is faster and better for anything live.
- Proxy vs VPN vs firewallThree tools that sit between a device and the network and are often confused. A proxy relays traffic, a VPN tunnels it with encryption, and a firewall decides what may pass at all.
Crafted in the dark. Shipped to the world.
Tell us what you are building. You get a private project space with a proposal and a line-by-line quote within a day.