Technology Fundamentals
Cookie
Definition
An HTTP cookie (or web cookie, browser cookie) is a small piece of data sent from a website and stored on the user's computer by the user's web browser while the user is browsing.
Why It Matters
Cookies are used to remember stateful information for the otherwise stateless HTTP protocol. They are essential for features like keeping users logged in, storing shopping cart items, and remembering user preferences.
Contextual Example
When you log in to a website, the server sends a cookie to your browser containing a session ID. On subsequent requests, your browser sends the cookie back, allowing the server to identify you and keep you logged in.
Common Misunderstandings
- Cookies are not programs and cannot execute code. They are simple text files.
- Third-party cookies (set by a domain other than the one you are visiting) are often used for advertising and tracking, which has raised privacy concerns.