Publications / Law and cookies
Types of cookies – first-party and third-party, session and persistent, necessary and marketing
Cookies are classified by origin, lifetime and purpose. Only the classification by purpose decides whether consent is needed. Examples of real cookies, similar technologies (localStorage, pixels) and common misconceptions.

Latest posts
- Google merged the Google tag with Tag Manager – what it changes for cookie consent
- Advertising on Google or measuring traffic? Check whether you need a cookie banner
- How should a proper cookie banner work?
- How to prepare your website for consetgo – pre-installation checklist
- Cookies in an online shop – a practical checklist
Cookies are classified in three ways: by who stores them, how long they live and what they are used for. For the banner and consent, only the third classification counts – the purpose. A cookie can be first-party and session-only and still require consent, because it is used for statistics.
By origin: first-party and third-party
- First-party – stored in the domain of the site you are visiting. Example: a cart session cookie, but also the Google Analytics _ga cookie, which the Google script stores in your site's domain.
- Third-party – stored in the domain of another service, e.g. IDE in the doubleclick.net domain (Google ads). Browsers increasingly restrict them, but that does not change the consent requirement.
By lifetime: session and persistent
- Session – deleted when the browser is closed.
- Persistent – have an expiry date, from minutes to years. Examples: _gid (24 hours), _fbp (90 days), _ga (2 years), IDE (13 months).
The lifetime must be stated in the cookie policy, but on its own it does not decide whether consent is needed.
By purpose: four categories
| Category | What it is for | Examples | Consent |
|---|---|---|---|
| Necessary | for the site to work and for the service the visitor requests | session, cart, login, security, remembering the choice in the banner | no |
| Functional | extras and convenience | chat, maps, embedded videos, remembered language | yes |
| Analytics | traffic and behaviour statistics | Google Analytics 4 (_ga, _gid), Hotjar | yes |
| Marketing | ad measurement, remarketing, profiling | Google Ads (_gcl_*), Meta Pixel (_fbp), TikTok, IDE | yes |
The basis: Article 5(3) of the ePrivacy Directive (implemented in national laws) exempts from consent only what is strictly necessary. Everything else – including “functional” cookies – requires consent.
Not only cookies: similar technologies
The consent rule covers any storing and reading of information on the device, not only cookies. The European Data Protection Board described this in Guidelines 2/2023 on the technical scope of Article 5(3) of the ePrivacy Directive. The same rules cover, among others:
- localStorage and sessionStorage in the browser,
- tracking pixels (e.g. a 1×1 image on a page or in an email),
- identifiers in link URLs,
- browser fingerprinting.
Common misconceptions
- “The cookie is first-party, so no consent is needed” – _ga is a first-party cookie, yet it is used for statistics.
- “The cookie is a session cookie, so no consent is needed” – the purpose decides about consent.
- “Analytics is necessary for the business” – necessary for the business is not the same as necessary for the site to work.
- “We don't use cookies, only localStorage” – the rule also covers other storage technologies.
How it looks in consetgo
The module has four categories: necessary, functional, analytics and marketing. For known services it has a list of cookies with their retention period and purpose – it shows this list to visitors in the banner settings and in the table for the cookie policy. How to assign services to categories: cookie categories for services. The law: ePrivacy Directive, EDPB guidelines.
Questions and answers
Do session cookies not require consent?
It is not the lifetime that decides, but the purpose. A session cookie for the cart is necessary, but a session cookie of an analytics tool requires consent, even though it disappears when the browser is closed.
Is localStorage also “cookies”?
The consent rule (Article 5(3) of the ePrivacy Directive) covers any storing and reading of information on the device – including localStorage, tracking pixels and browser fingerprinting. Website policies usually call all of them cookies.
Are first-party cookies safer?
The origin of a cookie does not exempt it from consent. The Google Analytics _ga cookie is stored in your site's domain, yet it is used for statistics and requires consent.
This is general information, not legal advice.