A small text file (up to 4KB) created by a website that is stored in the user's computer either temporarily for that session only or permanently in storage (persistent cookie). Cookies provide a way for a website to recognize previous visitors and keep track of their preferences. Anyone can view their stored cookies in the privacy section of the browser's settings, and single cookies can be manually deleted.
Cookies Are Beneficial
Cookies are commonly used to "maintain the state" of a browser session. For example, users can place items in a shopping cart, switch to another page or even another site, and when they come back, the site recognizes them and the current state of the cart. See
state and
stateless.
Cookies contain a range of URLs (addresses), and when the Web browser sends a request to a Web server with those URLs, it sends along the related cookies. For example, if user ID and password are stored in a cookie, it eliminates typing the same information over again when accessing the service the next time. By retaining user history, cookies allow the website to tailor pages for each individual.
Your Cookies Know You
Quite a bit of personal data may reside in the cookie files. As a result, this storehouse of private information is sometimes the object of attack (see
cookie poisoning).
First-Party Personal Cookies
The default settings in the Web browser typically allow "first-party" cookies, but not "third-party" cookies. First-party cookies are created by the website you visit.
Third-Party Tracking Cookies
Third-party cookies are created by a website other than the one being visited, typically by a third-party advertiser. The purpose is usually to track a user's surfing habits, which is why third-party cookies are considered an invasion of privacy and riskier than first-party cookies.
Configuring Settings
A Web browser can be configured so that only first-party cookies coming from the originating sites are maintained. It can also be set to prevent all cookies from being stored in the computer, but that limits the Web surfing experience. The choice is made in the browser settings. See
Web bug,
cookie file,
Flash cookie,
Evercookie,
magic cookie and
state.