Term Library / Concept card
What is web cookie? Plain-English meaning
A web cookie is a small text file that a website stores in your browser to remember information about you across visits or requests.
Back to Term LibraryBrowse Articles
Path: /term/web-cookie
Definition
A web cookie is a small text file that a website stores in your browser to remember information about you across visits or requests.
Also seen as: HTTP cookie, browser cookie, cookie
- Library
- Part of the Term Library
- Format
- Concept card
- Last updated
- September 7, 2026
- Sources and further reading
- 4
- Related articles
- 5
Plain-English explanation
When you visit a website, the site's server can send a small piece of data to your browser, which saves it as a cookie. On subsequent requests, your browser sends the cookie back to the server, allowing the site to recognize you or remember your preferences. Cookies are a standard way to manage state over the stateless HTTP protocol. They store things like login tokens, language choices, or items in a shopping cart. Because cookies can contain identifiers, they also raise privacy and security considerations.
Why it matters
Cookies affect everyday browsing: they keep you logged in, remember your settings, and enable shopping carts. They also underpin many advertising and analytics systems, so understanding cookies helps you make informed choices about privacy and security.
Concrete example
When you log in to an online store, the server sends a cookie with a unique session identifier. Your browser stores it and sends it back each time you click a product page, so the site knows you are still logged in and can keep your shopping cart updated.
Often confused with
People often confuse cookies with cache or other client-side storage like localStorage. Cookies are sent to the server with each request, whereas cache is stored to avoid re-downloading resources, and localStorage is a newer API that stores data without sending it automatically.
Short definition: A web cookie is a small text file that a website stores in your browser to remember information about you across visits or requests.
Plain-English explanation
When you visit a website, the site's server can send a small piece of data to your browser, which saves it as a cookie. On subsequent requests, your browser sends the cookie back to the server, allowing the site to recognize you or remember your preferences. Cookies are a standard way to manage state over the stateless HTTP protocol. They store things like login tokens, language choices, or items in a shopping cart. Because cookies can contain identifiers, they also raise privacy and security considerations.
Why it matters
Cookies affect everyday browsing: they keep you logged in, remember your settings, and enable shopping carts. They also underpin many advertising and analytics systems, so understanding cookies helps you make informed choices about privacy and security.
Concrete example
When you log in to an online store, the server sends a cookie with a unique session identifier. Your browser stores it and sends it back each time you click a product page, so the site knows you are still logged in and can keep your shopping cart updated.
Common confusion
People often confuse cookies with cache or other client-side storage like localStorage. Cookies are sent to the server with each request, whereas cache is stored to avoid re-downloading resources, and localStorage is a newer API that stores data without sending it automatically.
Related terms
session, localStorage, HTTP header, client-side storage, tracking
How people actually use it
Websites set cookies in a user's browser to store session identifiers or preferences, which are sent back with each request. Users can manage or block cookies through browser settings, and developers use them for analytics, authentication, and targeted advertising.
Related terms explained
session
A session is a temporary state that links a user's requests to a server over a limited time. Cookies often carry a session ID to maintain that state between page loads.
Example: After logging in, a website sets a session cookie that keeps the user authenticated until they log out.
third-party cookie
A third-party cookie is set by a domain other than the one the user is currently visiting. It is commonly used for cross-site tracking and advertising, and many browsers now block them by default.
Example: An ad network places a third-party cookie to track a user across multiple news websites.
localStorage
localStorage is a web storage API that stores data in a browser with no expiration date. Unlike cookies, it is not sent automatically with HTTP requests and has a larger storage limit.
Example: A web app saves user preferences in localStorage so they persist after the browser is closed.
HTTP header
An HTTP header is a field in a request or response message that carries metadata, such as content type or authentication tokens. Cookies are transmitted via the 'Set-Cookie' and 'Cookie' headers.
Example: A server sends a 'Set-Cookie' header in its response to instruct the browser to store a cookie.
Practical tips
Array
Common questions
Array
Key takeaways
Array
Step by step
Array
More context
Cookies were introduced in 1994 by Netscape to enable shopping carts and session tracking. They are limited in size (usually 4KB per cookie) and are sent back to the server with every request to the same domain. Modern browsers also support 'SameSite' attributes to restrict when cookies are sent, reducing cross-site tracking risks.
Sources and further reading
- Using HTTP cookiesCookies store small pieces of data for HTTP state management and have privacy/security implications.
- Set-Cookie headerServers use Set-Cookie to ask the browser to store a cookie for later requests.
- RFC 6265: HTTP State Management MechanismCookies are a standard mechanism for state management between browsers and websites.
- Client-side storageClient-side storage includes cookies, localStorage, and IndexedDB for keeping data in the browser.