Skip to content
Commitpedia
Log in Join & edit

What is a cookie?

A cookie is a small piece of text a website stores in your browser so it can recognise you on the next request.

Drafted with AI from official documentation. Scripts were run in a test environment and repository links verified. Awaiting a human check. Did it work for you? Last edited Outdated?

Edit history of What is a cookie?: 1 recorded edit
Edit history · 1 edit
Type
Article
Edits
1
Editors
1
First issued
15 Oct 2026
Last edit
15 Oct 2026
Reading
1 min

A cookie is a tiny name and value pair that a server asks the browser to keep and send back with every later request to the same site. HTTP itself forgets you after each request, so cookies are the coat check ticket: the server hands you a number, and when you show it again it knows which coat (session) is yours.

Cookies keep you logged in, remember your language and shopping basket, and, less pleasantly, track you for advertising. Important flags are Secure (only over HTTPS), HttpOnly (JavaScript cannot read it) and SameSite (limits sending to other sites). You can inspect them in the browser developer tools under Application or Storage.

Set-Cookie: session=abc123; Path=/; Secure; HttpOnly; SameSite=Lax

See also: What is a token? and What is HTTP?

Did this work for you?

No votes yet. Be the first.

If it did not work, the report form below tells the editors what went wrong.

See also

  • 0083 Test a JSON API with curl A runnable bash script showing the curl commands you need most when testing an API: GET, POST JSON, custom headers, Bearer tokens,… Beginner · Step by step · Linux, macOS, Windows Script Authentication · Making requests 15 Oct 2026
  • 0086 API authentication basics: API keys, Bearer tokens, and OAuth How APIs know who is calling: static API keys, Bearer tokens in the Authorization header, Basic auth, and a high-level tour of… Intermediate · Explains an idea · Any system Article Authentication 15 Oct 2026
  • 0305 What is a token? A token is a string that proves who you are or what you may do, sent with requests instead of a password. Beginner · Explains an idea · Any system Article Authentication 15 Oct 2026

History

Every saved edit is kept. The plot on the sleeve draws one line per edit. Open any edit to see exactly what changed.

  1. Dominik +767 chars

Report a problem

Something wrong, unsafe or copied? Tell the editors.
What is wrong?