Skip to content
ContentLora

    Tip: press / anywhere to search.

    Explainer

    How cookies and web tracking work, and how browsers limit them

    A cookie is a small piece of data a server asks the browser to store and send back on later requests, which lets websites remember sign-ins and settings over the otherwise stateless HTTP protocol.[1][2] Third-party cookies, set by content embedded on many sites such as ad networks, can follow a person from site to site.[3] Safari began blocking them by default in 2020 and Firefox began giving every site its own separate cookie jar on desktop in 2022, while Chrome still allows them unless users choose otherwise.[4][5][6] Tracking can also work without cookies, through browser fingerprinting.[7]

    Editor reviewedUpdated Explainer24 claims · 54% primaryComputing, Internet and telecoms

    This explainer describes how cookies work technically and summarizes published browser policies and UK regulator guidance. It is not legal advice; browser settings and privacy rules change often, so check the dates.

    HTTP itself is mostly stateless, and cookies let a server keep state over it: it includes a Set-Cookie header in a response, and the browser returns the stored value in a Cookie header on later requests.[1] The IETF’s cookie specification acknowledges that cookies have many historical flaws that weaken security and privacy, even though they are widely used.[8] MDN lists three main uses: session management such as sign-ins and shopping carts, personalization such as language settings, and tracking, meaning recording and analyzing user behaviour.[2]

    A typical sign-in works like this: after a correct password, the server sends a cookie containing a session ID, and the browser sends it with each later request to show the user is still signed in.[9]

    Browsers typically cap cookies at hundreds per domain and about 4KB each, and a cookie without Max-Age or Expires is a session cookie, deleted when the browser decides the session has ended.[10] The Secure attribute restricts a cookie to HTTPS requests, and HttpOnly hides it from JavaScript, which helps mitigate cross-site scripting.[11] SameSite (Strict, Lax or None) controls whether a cookie goes with cross-site requests; Chromium-based browsers default to Lax when it is not set.[12]

    First-party and third-party cookies

    A cookie whose domain and scheme match the page in the address bar is a first-party cookie; one from a different site, often set by embedded content such as images or iframes, is a third-party or cross-site cookie.[13] Third-party cookies have legitimate uses, such as a sign-in widget shared across related sites or affiliate links that credit a referrer.[14]

    They also enable tracking. When a page loads resources from other servers, such as advertising networks, those servers can use cookies to follow the user from site to site even if the user never visits them directly.[3] MDN warns that third-party servers can combine information gathered across many sites into a detailed profile of a person’s browsing history, interests and habits.[15]

    How browsers limit tracking

    In March 2020 WebKit announced that Safari blocks cookies for cross-site resources by default, calling it the first mainstream browser to fully block third-party cookies by default.[4] WebKit created the Storage Access API so that signed-in embedded content can get cookie access only with the user’s permission.[16]

    Mozilla turned on Enhanced Tracking Protection, which blocks trackers on a maintained list, by default for all Firefox users in 2019.[17] In June 2022 it made Total Cookie Protection a default for all Firefox desktop users worldwide; this gives each website its own “cookie jar”, so cookies set on one site, including by embedded third parties, cannot be read on others.[5]

    Google Chrome does not block third-party cookies by default, only in Incognito mode or when users choose to.[6] In April 2025 Google said it would keep offering users a choice over third-party cookies and would not roll out a new standalone prompt.[6] In October 2025 it said it would retire several Privacy Sandbox technologies, including the Topics API and Protected Audience, citing their expected value and low adoption.[18]

    Tracking without cookies

    Blocking cookies does not end tracking, because fingerprinting identifies a browser, and often its user, by combining distinguishing features of the browser and operating system collected with JavaScript and CSS, which can produce a unique fingerprint usable across the web.[7] Web standards are designed to limit how much identifying information sites can collect, browsers add their own protections, and Mozilla says Firefox protects against fingerprinting and supercookies.[19] Some techniques, called “zombie” cookies, recreate cookies after a user deletes them; MDN says these violate user privacy and control and may breach data privacy rules.[20]

    MDN notes that laws such as the EU’s GDPR and California’s Consumer Privacy Act require companies to be transparent about the cookies they set and the data they collect.[21] In the UK, the Information Commissioner’s Office explains that under the PECR rules sites must tell people about the cookies they set, explain what they do and get consent, except for cookies essential to a service the user asked for, such as a shopping basket.[22] The ICO says consent needs a clear positive action, non-essential cookies cannot be set before consent is given, and the same rules cover similar technologies that store or read information on a device.[23] The ICO’s page notes that it reflects the previous version of its guidance and that revised guidance on storage and access technologies is out for consultation.[24] For the wider legal picture, see the GDPR explainer and data privacy laws.

    More in Computing

    Developing in AI & Computing

    Questions readers ask

    What is a browser cookie?

    A small piece of data a server sends to your browser in a Set-Cookie header. The browser stores it and returns it on later requests, so the site can remember state such as whether you are signed in.[1][9]

    What is the difference between first-party and third-party cookies?

    A first-party cookie comes from the site in your address bar. A third-party, or cross-site, cookie comes from a different site, often through embedded content such as images or iframes.[13]

    How do third-party cookies track me?

    Servers whose content is embedded on many sites, such as advertising networks, can use cookies to recognize you on each of those sites, even if you never visit them directly.[3]

    Does Chrome block third-party cookies?

    Not by default. It blocks them in Incognito mode or when users choose to. In April 2025 Google said it would keep offering users a choice and would not roll out a new standalone prompt.[6]

    Can websites track me without cookies?

    Yes. Fingerprinting combines distinguishing features of a browser and operating system, collected with JavaScript and CSS, into an often unique fingerprint that can track users across the web.[7]

    Why do UK websites ask for cookie consent?

    The ICO's guidance on the UK's PECR rules says sites must explain the cookies they set and get consent, except for cookies essential to a service you asked for, such as a shopping basket.[22]

    Sources

    · 24 claims from 6 publishers

    Each numbered claim is a statement we checked against the sources listed with it. Tap a number in the text to see its sources in place.

    1. [1]

      A cookie is a small piece of data that a server sends to a browser in a Set-Cookie header; the browser stores it and returns it in a Cookie header on later requests, letting servers keep state over the otherwise stateless HTTP protocol. confirmedas of 2026-11-14

    2. [2]

      MDN lists three main uses for cookies - session management such as sign-in status and shopping carts, personalization such as language and theme preferences, and tracking, meaning recording and analyzing user behavior. reportedas of 2026-11-14

      • Using HTTP cookies · MDN Web Docs (Mozilla) · Secondary source · Using HTTP cookies (retrieved 2026-11-14)
      • Using HTTP cookies · MDN Web Docs (Mozilla) · Secondary source · Using HTTP cookies (retrieved 2026-11-14)
      • Using HTTP cookies · MDN Web Docs (Mozilla) · Secondary source · Using HTTP cookies (retrieved 2026-11-14)
      • Using HTTP cookies · MDN Web Docs (Mozilla) · Secondary source · Using HTTP cookies (retrieved 2026-11-14)
    3. [3]

      Third-party servers, such as advertising networks whose content is embedded on many sites, can use cookies to track a user between those sites even if the user never visits the third party directly. confirmedas of 2026-11-14

    4. [4]

      In March 2020, WebKit announced that Safari 13.1 and iOS and iPadOS 13.4 block cookies for cross-site resources by default, and said Safari was the first mainstream browser to fully block third-party cookies by default. confirmedas of 2026-11-14

    5. [5]

      In June 2022 Mozilla made Total Cookie Protection a default for all Firefox desktop users worldwide; it gives each website its own separate "cookie jar", so cookies set on one site, including by embedded third-party content, cannot be read on other sites. confirmedas of 2026-11-14

    6. [6]

      Google Chrome does not block third-party cookies by default, only in Incognito mode or when users choose to; in April 2025 Google said it would keep its current approach of offering users third-party cookie choice and would not roll out a new standalone prompt. confirmedas of 2026-11-14

    7. [7]

      Fingerprinting identifies a browser, and so often a user, by combining distinguishing features of the browser and operating system collected with JavaScript and CSS, often producing a unique fingerprint that can track users across the web without cookies. reportedas of 2026-11-14

      • Fingerprinting · MDN Web Docs (Mozilla) · Secondary source · Glossary: Fingerprinting (retrieved 2026-11-14)
      • Fingerprinting · MDN Web Docs (Mozilla) · Secondary source · Glossary: Fingerprinting (retrieved 2026-11-14)
    8. [8]

      The IETF's cookie specification, RFC 6265, acknowledges that cookies have many historical flaws that weaken their security and privacy, even though the Cookie and Set-Cookie headers are widely used. confirmedas of 2026-11-14

    9. [9]

      In a typical sign-in system, the server responds to correct credentials with a cookie containing a session ID, and the browser sends that cookie with later requests to show the user is still signed in. reportedas of 2026-11-14

      • Using HTTP cookies · MDN Web Docs (Mozilla) · Secondary source · Using HTTP cookies, sign-in example (retrieved 2026-11-14)
      • Using HTTP cookies · MDN Web Docs (Mozilla) · Secondary source · Using HTTP cookies, sign-in example (retrieved 2026-11-14)
    10. [10]

      Browsers typically cap cookies at hundreds per domain and about 4KB each; cookies without a Max-Age or Expires attribute are session cookies, deleted when the browser decides the current session has ended. reportedas of 2026-11-14

      • Using HTTP cookies · MDN Web Docs (Mozilla) · Secondary source · Using HTTP cookies (retrieved 2026-11-14)
      • Using HTTP cookies · MDN Web Docs (Mozilla) · Secondary source · Removal: defining the lifetime of a cookie (retrieved 2026-11-14)
    11. [11]

      A cookie with the Secure attribute is only sent over encrypted HTTPS requests, and one with the HttpOnly attribute cannot be read by JavaScript, which helps mitigate cross-site scripting attacks. reportedas of 2026-11-14

      • Using HTTP cookies · MDN Web Docs (Mozilla) · Secondary source · Security (retrieved 2026-11-14)
      • Using HTTP cookies · MDN Web Docs (Mozilla) · Secondary source · Security (retrieved 2026-11-14)
      • Using HTTP cookies · MDN Web Docs (Mozilla) · Secondary source · Security (retrieved 2026-11-14)
    12. [12]

      The SameSite attribute, with the values Strict, Lax and None, controls whether a cookie is sent with cross-site requests; if a site does not set it, Chromium-based browsers default to Lax, and other browsers vary. reportedas of 2026-11-14

      • Using HTTP cookies · MDN Web Docs (Mozilla) · Secondary source · Controlling third-party cookies with SameSite (retrieved 2026-11-14)
      • Using HTTP cookies · MDN Web Docs (Mozilla) · Secondary source · Controlling third-party cookies with SameSite (retrieved 2026-11-14)
      • Third-party cookies · MDN Web Docs (Mozilla) · Secondary source · Using SameSite (retrieved 2026-11-14)
    13. [13]

      A cookie whose domain and scheme match the page in the address bar is a first-party cookie; one from a different site, often set by embedded content such as images or iframes, is a third-party (cross-site) cookie. reportedas of 2026-11-14

      • Third-party cookies · MDN Web Docs (Mozilla) · Secondary source · What are third-party cookies? (retrieved 2026-11-14)
      • Third-party cookies · MDN Web Docs (Mozilla) · Secondary source · What are third-party cookies? (retrieved 2026-11-14)
      • Third-party cookies · MDN Web Docs (Mozilla) · Secondary source · How are third-party cookies set? (retrieved 2026-11-14)
    14. [14]

      Third-party cookies also have legitimate uses, such as a sign-in widget shared across related sites or affiliate links that credit a referrer. reportedas of 2026-11-14

      • Third-party cookies · MDN Web Docs (Mozilla) · Secondary source · Why are third-party cookies used? (retrieved 2026-11-14)
      • Third-party cookies · MDN Web Docs (Mozilla) · Secondary source · Why are third-party cookies used? (retrieved 2026-11-14)
    15. [15]

      MDN warns that third-party servers can combine information from cookies set across many sites into a detailed profile of a user's browsing history, interests and habits. reportedas of 2026-11-14

      • Third-party cookies · MDN Web Docs (Mozilla) · Secondary source · What's the problem with third-party cookies? (retrieved 2026-11-14)
    16. [16]

      WebKit created the Storage Access API so that signed-in embedded content can get cookie access only with the user's permission. confirmedas of 2026-11-14

    17. [17]

      Mozilla introduced Enhanced Tracking Protection, which blocks trackers on a maintained list, in 2018 and turned it on by default for all Firefox users in 2019. confirmedas of 2026-11-14

    18. [18]

      In October 2025 Google said it would retire several Privacy Sandbox technologies, including the Topics API and Protected Audience, citing their expected value and low adoption. confirmedas of 2026-11-14

    19. [19]

      Web standards are designed to limit how much identifying information a site can collect, and browsers typically add their own protections; Mozilla says Firefox has added protections against fingerprinting and supercookies. reportedas of 2026-11-14

    20. [20]

      Some techniques, known as "zombie" cookies, recreate cookies after a user deletes them; MDN says they violate user privacy and control and may breach data privacy rules. reportedas of 2026-11-14

      • Using HTTP cookies · MDN Web Docs (Mozilla) · Secondary source · Removal: defining the lifetime of a cookie (retrieved 2026-11-14)
    21. [21]

      MDN notes that laws such as the EU's GDPR and the California Consumer Privacy Act require companies to be transparent about the cookies they set and the information they collect. reportedas of 2026-11-14

      • Third-party cookies · MDN Web Docs (Mozilla) · Secondary source · What's the problem with third-party cookies? (retrieved 2026-11-14)
    22. [24]

      The ICO's cookie guidance page says it is based on the previous version of its guidance and that the ICO is consulting on revised guidance on storage and access technologies. confirmedas of 2026-11-14

    Revision history (1)
    1. Page created.

    Created Nov 14, 2026. Last reviewed by an editor on Nov 14, 2026. Next scheduled review: Feb 14, 2027.

    Cite this page

    "How cookies and web tracking work, and how browsers limit them." ContentLora, updated Nov 14, 2026. https://contentlora.com/explain/how-cookies-and-web-tracking-work

    Spotted an error? Suggest a correction or emailcorrections@contentlora.com.