Term Library / Concept card
What is cookie? Plain-English meaning
A cookie is a small text file that a website stores in your browser to remember information about you between visits.
Back to Term LibraryBrowse Articles
Path: /term/cookie
Definition
A cookie is a small text file that a website stores in your browser to remember information about you between visits.
Also seen as: HTTP cookie, web cookie, browser 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 server can send a piece of data to your browser with instructions to store it. That stored piece of data is called a cookie. On your next visit, your browser sends the cookie back to the site, which lets the site recognize you and remember your preferences or actions. Cookies are a standard way for websites to keep you logged in, remember items in your shopping cart, or track your browsing for advertising. They are stored on your device, not on the website's server, and each cookie is tied to the domain that created it.
Why it matters
You encounter cookies almost every time you go online, and they directly affect your privacy and convenience. Understanding cookies helps you know why a site remembers your login, why you see certain ads, and why you get those 'accept cookies' pop-ups. It also helps you decide when to clear or block cookies to protect your privacy without breaking the sites you use.
Concrete example
Imagine you add a book to your shopping cart on an online bookstore, then close your browser. When you open the browser again and return to the bookstore, the site still shows the book in your cart. That happens because the bookstore set a cookie on your device that records your cart contents. Without that cookie, the site would treat you as a new visitor and your cart would be empty.
Often confused with
People often confuse cookies with other types of browser storage, especially localStorage or sessionStorage. While cookies, localStorage, and sessionStorage all store data in your browser, they differ in how they are used and how long they last. Cookies are sent to the server with every request, which makes them useful for authentication and tracking, but they have a small size limit. localStorage and sessionStorage are designed for larger client-side data that does not need to be sent to the server, and sessionStorage clears when the tab closes, while cookies can have a set expiration date.
Short definition: A cookie is a small text file that a website stores in your browser to remember information about you between visits.
Plain-English explanation
When you visit a website, the server can send a piece of data to your browser with instructions to store it. That stored piece of data is called a cookie. On your next visit, your browser sends the cookie back to the site, which lets the site recognize you and remember your preferences or actions. Cookies are a standard way for websites to keep you logged in, remember items in your shopping cart, or track your browsing for advertising. They are stored on your device, not on the website's server, and each cookie is tied to the domain that created it.
Why it matters
You encounter cookies almost every time you go online, and they directly affect your privacy and convenience. Understanding cookies helps you know why a site remembers your login, why you see certain ads, and why you get those 'accept cookies' pop-ups. It also helps you decide when to clear or block cookies to protect your privacy without breaking the sites you use.
Concrete example
Imagine you add a book to your shopping cart on an online bookstore, then close your browser. When you open the browser again and return to the bookstore, the site still shows the book in your cart. That happens because the bookstore set a cookie on your device that records your cart contents. Without that cookie, the site would treat you as a new visitor and your cart would be empty.
Common confusion
People often confuse cookies with other types of browser storage, especially localStorage or sessionStorage. While cookies, localStorage, and sessionStorage all store data in your browser, they differ in how they are used and how long they last. Cookies are sent to the server with every request, which makes them useful for authentication and tracking, but they have a small size limit. localStorage and sessionStorage are designed for larger client-side data that does not need to be sent to the server, and sessionStorage clears when the tab closes, while cookies can have a set expiration date.
Related terms
session, localStorage, third-party cookie, HTTP header, same-site
Practical tips
Array
Common questions
Array
Key takeaways
Array
Step by step
Array
More context
Cookies were invented in 1994 by Lou Montulli, an engineer at Netscape, to enable shopping carts in e-commerce. They are part of the HTTP protocol and are defined by RFC 6265. Over time, concerns about privacy led to restrictions on third-party cookies, with browsers like Safari and Firefox blocking them by default, and Chrome planning to phase them out.
Additional background
Cookies, technically called HTTP cookies, are fundamental to the modern web experience. They were introduced to solve the problem of HTTP's statelessness, allowing servers to remember users between requests. A cookie is created by a server and sent to the browser, which stores it and returns it on subsequent visits. This enables features like shopping carts, login sessions, and personalized content. However, cookies also enable cross-site tracking, which has led to privacy regulations and browser restrictions. Modern browsers offer options to block third-party cookies, and some have even announced plans to phase them out entirely. There are also alternatives like local storage and token-based authentication, but cookies remain widely used due to their simplicity and support. Understanding how cookies work helps users make informed choices about their privacy and helps developers design secure, user-friendly web applications.
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.