Cookies
Cookies
Section titled “Cookies”Introduction
Section titled “Introduction”Cookies are small pieces of data stored by the browser. Unlike Web Storage, cookies are automatically sent to the server with every HTTP request.
Topics Covered
Section titled “Topics Covered”- Reading Cookies — Accessing cookies with document.cookie
- Writing Cookies — Setting cookies with options
- Deleting Cookies — Removing cookies
- Cookies vs Web Storage — When to use which
Summary
Section titled “Summary”Cookies are sent with every HTTP request (~4KB limit). Use Secure, SameSite, and HttpOnly flags. Prefer Web Storage for non-authentication data.