Cookie Confirm

What are cookies? Types explained

What cookies are, the difference between first-party and third-party, session and persistent cookies, and which types need consent in the EU and the UK.

Last checked on 13 October 2026

In short

  • A cookie is a small text file a website stores in the visitor's browser.
  • Strictly necessary cookies don't need consent; marketing and tracking cookies always do.
  • Analytics cookies need consent in most EU countries; the UK now has an exception for some of them.
  • The same rules apply to similar techniques such as pixels, local storage and fingerprinting.

What is a cookie?

A cookie is a small text file that a website stores in the visitor's browser. The next time the browser loads a page from that site, it sends the cookie back. That lets a website remember things: that you are logged in, what is in your shopping cart, which language you chose, or that you have visited before.

Cookies themselves are neither good nor bad. What matters is what they are used for. A cookie that keeps your cart is something you need; a cookie that follows you across hundreds of websites to build an ad profile is something you have to agree to first.

The cookie rule in short

In the EU, the rule is in article 5(3) of the ePrivacy Directive, implemented in each country's own law. In the UK it is regulation 6 of PECR. The basic rule is the same: you may only store information on a visitor's device, or read it from there, if the visitor has been given clear information and has consented.

There are exceptions. In the EU, consent is not needed for storage that is strictly necessary for a service the visitor explicitly asked for, or only used to transmit a communication. Where consent is needed, it must meet the GDPR standard: freely given, specific, informed and by a clear action. The EU Court of Justice ruled in Planet49 (2019) that a pre-ticked box is not valid consent, whether or not the cookie contains personal data.

Types of cookies

By who sets them

  • First-party cookies are set by the website you visit, under its own domain.
  • Third-party cookies are set by another domain, for example an ad network, a video platform or a social media widget embedded in the page.

By how long they last

  • Session cookies disappear when you close the browser.
  • Persistent cookies stay until a set expiry date, from minutes to years. Google Analytics' _ga cookie, for example, lasts two years by default.

By purpose

This is the classification that decides whether you need consent.

Purpose Examples Consent needed in the EU? Consent needed in the UK?
Strictly necessary Shopping cart, login session, load balancing, security, the cookie choice itself No No
Preferences Language, region, dark mode No if they only remember a choice the visitor made, such as a language switch; otherwise often yes No for adapting appearance or functionality, if visitors can object
Statistics / analytics Visitor counts, page views, Google Analytics Usually yes; some countries exempt strictly configured analytics No if only for aggregate statistics to improve your own site, if visitors can object
Marketing / tracking Meta Pixel, Google Ads, LinkedIn Insight Tag, retargeting Yes Yes
Embedded content YouTube videos, maps, social media posts Usually yes Usually yes

The UK exceptions were added to PECR by the Data (Use and Access) Act 2025 and apply since 5 February 2026. In the EU, whether analytics cookies may be used without consent depends on the country; the French CNIL and the Dutch rules, for example, allow it under strict conditions. More in Google Analytics and the GDPR.

Not just cookies

The rule is technology-neutral. It covers anything that stores information on a device or reads it from there. In its Guidelines 2/2023, the EDPB lists, among others:

  • Local storage and session storage in the browser;
  • Tracking pixels and link decoration (identifiers added to URLs);
  • Scripts that collect information from the device and send it to a server;
  • Fingerprinting, which recognizes a device by its characteristics;
  • identifiers in apps and connected devices.

The ICO's guidance for the UK takes the same broad view and speaks of "storage and access technologies". So "we don't use cookies, only a pixel" does not get you out of the rules.

What this means for your website

  1. Find out what your site really sets. Plugins, embedded videos and marketing tags often add cookies you don't know about. A cookie scanner shows them.
  2. Sort them by purpose: strictly necessary, preferences, statistics and marketing.
  3. Block everything that needs consent until the visitor agrees, and make rejecting as easy as accepting.
  4. Explain it in a cookie policy: each cookie, its purpose, who sets it and how long it lasts. See our cookie policy template.

Cookie Confirm scans your site every month (plus unlimited rescans), sorts the cookies it finds, blocks scripts until consent and keeps your cookie policy up to date.

Sources

Frequently asked questions

Are cookies personal data?

Often, yes. A cookie with a unique ID that recognizes a visitor is usually personal data under the GDPR. But the cookie rule applies anyway: the EU Court of Justice ruled in Planet49 (2019) that consent is needed whether or not the information is personal data.

Do functional cookies need consent?

Not if they are strictly necessary for a service the visitor asked for, such as a shopping cart, a login session or remembering the cookie choice. You still have to tell visitors about them, for example in your cookie policy.

Do analytics cookies need consent?

In most of the EU, yes, unless a national exemption applies and you meet its strict conditions (for example in France and the Netherlands). In the UK, cookies used only to produce statistics to improve your own site no longer need consent since February 2026, provided you inform visitors and let them object.

What is the difference between a first-party and a third-party cookie?

A first-party cookie is set by the website you visit, under its own domain. A third-party cookie is set by another domain, such as an ad network or social media widget embedded in the page. Third-party cookies are often used to follow visitors across websites.

Is a cookie banner enough?

Only if it really blocks the cookies that need consent until the visitor agrees. A banner that just informs while tracking already runs does not meet the rules.

This guide is general information, not legal advice. We check it regularly, but laws and guidance change. Not sure about your situation? Ask a lawyer.

Enjoy the first 7 days completely free

Create a free account and see if Cookie Confirm is the right fit for you. Live in 5 minutes.

  • No credit card required
  • €7.95 per month after
  • Plug & play installation
Start my free trial

4.9/5 5,000+ websites