Dev Guide

Web APIs

Browser and network APIs every web app relies on.

About Web APIs

Every web browser has its own set of storage APIs. Websites use them to remember a logged-in user, keep a shopping cart, save a draft, or work offline. Choosing the wrong one leads to lost data, security problems or slow pages.

These guides cover each browser storage option in turn: cookies, localStorage, sessionStorage, IndexedDB, and the newer Origin Private File System, which lets a full SQLite database run in the browser. Each guide explains what the API is for, its limits, and the mistakes developers make most often.

A quick rule of thumb: use a cookie when the server needs the value on every request, such as a login session. Use localStorage for small settings that should survive a restart, sessionStorage for data that belongs to one tab, and IndexedDB when you need to store many records or larger, structured data.

You can practise most of them for real in the Web Storage and IndexedDB playgrounds, which run your commands against the browser's actual APIs.

Start here

  1. 1
    HTTP Cookies

    How cookies work, and the security flags every login cookie needs.

  2. 2
    localStorage

    The simplest browser storage, and when it is the wrong choice.

  3. 3
    IndexedDB

    The browser's real database, for larger and structured data.