Browser & Tracking

Cookie

About 4 min read

What Are Cookies

A cookie is a small piece of text data that a website stores in the user's browser. By reading this data on subsequent visits, websites can maintain login sessions, preserve shopping cart contents, and remember language preferences.

Cookies grew out of a mechanism proposed by Netscape to overcome the limitation of HTTP being a stateless protocol. Refusing all cookies can leave you unable to sign in to some sites.

RFC 6265 asks browsers to store at least 4,096 bytes per cookie and at least 50 cookies per domain, and the actual limits depend on each browser's implementation. That is why one design stores only an identifier in the cookie and keeps the real data on the server.

Types and Roles of Cookies

Session Cookie
A temporary cookie that is automatically deleted when the browser is closed. Used for managing login sessions and temporarily holding form input.
Persistent Cookie
A cookie with an expiration date that persists even after the browser is closed. Used for remembering language and theme settings, and "remember me" login features.
First-Party Cookie
A cookie set by the website you are visiting. Required for basic site functionality and poses relatively low privacy risk.
A cookie set by a domain different from the site you are visiting. Used by ad networks to track users across sites, raising significant privacy concerns.

Cookies and Privacy

Cookies became a privacy concern primarily because of cross-site tracking through third-party cookies. Ad networks set third-party cookies via tracking pixels embedded across multiple sites, recording users' browsing behavior.

In the EU, Article 5(3) of the ePrivacy Directive, which is separate from the GDPR (EU General Data Protection Regulation), allows storing information such as cookies on a user's device, or reading it, only with consent or where it is necessary for the specific purposes set out in that Article. In Japan, under Article 31 of the amended Act on the Protection of Personal Information, a business providing personal-related information such as cookies to a third party that is expected to obtain it as personal data must confirm that the person's consent has been obtained.

Browsers have also taken action: Safari blocks third-party cookies by default through ITP (Intelligent Tracking Prevention), and Firefox uses Total Cookie Protection to keep third-party cookies in a separate jar for each site you visit so they cannot be read across sites, while Chrome proposed in July 2024 to let users choose instead of phasing out third-party cookies, and announced in April 2025 that it would keep the current approach of letting users choose in its privacy and security settings, without a new standalone prompt.

How to Manage Cookies Safely

  • Regular deletion: Periodically deleting cookies from your browser settings resets accumulated tracking data.
  • Block third-party cookies: Blocking third-party cookies in your browser settings reduces cross-site tracking. However, cross-site single sign-on and embedded payment or comment widgets can break, so add a per-site exception when that happens.
  • Cookie management extensions: Extensions like Cookie AutoDelete can automatically remove unnecessary cookies when you close a tab.
  • Do Not Track setting: Enabling your browser's DNT setting signals websites that you prefer not to be tracked. However, compliance by websites is voluntary.

To learn more about this topic, see Cookies and Tracking: How Your Online Behavior Is Being Monitored.

Common Misconceptions

Cookies are a type of virus or malware
Cookies are simply text data and have no ability to execute programs. However, when used for tracking purposes, they can impact your privacy.
Disabling all cookies makes you safe
Completely disabling cookies can break basic website features like login and shopping cart functionality. One approach is to block only third-party cookies while allowing first-party cookies.
Share

Related Terms

Related Articles