Skip to Content
Platform.Ontology

First party cookies

Small name and value pairs a site stores in the browser and gets back on every request.

Works without askingFiles and storageIn sessionWeb browsersWhile you use itWhen you are signed inAfter you leave the site

In one line

Can keep small notes in your browser and get them back on every visit

Small name and value pairs a site stores in the browser and gets back on every request.

The base identifier of the web: a random ID in a cookie lets a site recognise a returning browser, keep a login, and join visits into one profile. It is sent automatically with every matching request, so the person never has to act.

What it can and can't do

What the user does: Nothing. It happens when you visit, sign in or accept a cookie banner.

It can

  • Keep you signed in
  • Remember settings and your cart
  • Send the note back with each request to its own site
  • Count your visits and recognize you when you return

It cannot

  • See cookies that belong to other sites
  • Store much, since each cookie holds about 4 KB
  • Keep them after you clear cookies
  • Follow you across other sites on its own

Browser support

Chromeworks
Edgeworks
Firefoxworks
Safariworks
iPhoneworks
Androidworks
Samsungworks
BrowserStatusFirst versionReleasedNote
ChromeSupported12008-12-11None
EdgeSupported122015-07-29None
FirefoxSupported12004-11-09None
SafariSupported12003-06-23None
Safari on iPhoneSupported12007-06-29None
Chrome on AndroidSupported182012-06-27None
Samsung InternetSupported1.02013-04-27None

How a site asks for it

APISet-Cookie header; document.cookie; cookieStore.get()
Browser compat keyshttp.headers.Set-Cookie
api.Document.cookie
api.CookieStore
How access is grantednone
What the user seesNone
Needs a secure context (HTTPS)No
Needs a user gestureNo
How long it lastsSession cookie until browser closes, or up to 400 days in Chrome (cap since Chrome 104), 7 days for script set cookies in Safari
How to take it backClear site data, browser privacy settings
Inside an iframeNot listed

Data you get

What comes back: Cookie name and value
Shape: string
How often: any request or script write

FieldTypeUnitRangePrecision
sizeintegerbytesup to about 4096 per cookieexact
lifetimeintegerdayssession to 400exact

Technical limits

  • About 4096 bytes per cookie (name plus value)
  • Chrome allows roughly 180 cookies per domain and Firefox 150
  • Chrome caps Expires and Max-Age at 400 days
  • Safari ITP caps script set cookies at 7 days
  • SameSite=Lax is the Chrome default since Chrome 80
  • HttpOnly hides a cookie from scripts

The story

What it is

Small name and value notes that a site keeps in your browser and gets back with every visit.

For you

You see it as staying logged in, a saved language and a cart that waits for you. Many sites show a cookie banner, which is about the cookies they plan to set.

For makers

First party cookies keep logins, carts and settings working. Makers also use them for analytics and for remembering who you are. Third party cookies are different and are being limited.

Where you see it

TypeExampleApps
shoppingA store remembers your cart for a week so you can come back and check out.Amazon
socialA social site keeps you signed in so you do not enter a password each day.None named
gamesA browser game keeps your player ID and best score between visits.None named
analyticsA site counts unique visitors by giving each browser a random ID cookie.Google Analytics
adsA site stores a click ID from an ad so it can later credit the ad for a sale.Meta, Google Ads
securityA bank sets a short lived cookie after login and uses it to block stolen sessions.None named
newsA news site counts articles read this month to decide when to show a paywall.None named

Risks

  • Tracks you across visits
  • Can be stolen

What the platform says

Good uses and abuse

Legitimate uses

  • Login sessions, carts, preferences

Known abuse

  • Unique ID cookies joined across pages and, with sync, across sites

Scores

ScoreValueMeaning
Sensitivity3 of 5How revealing the data is
Utility5 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bits0Rough identifying entropy, when known

History

  • 2019-09, Safari 13: ITP 2.3 capped script set cookies at 7 days (24 h when from link decorated visits)
  • 2020-02, Chrome 80: SameSite=Lax by default for cookies without the attribute
  • 2022-08, Chrome 104: Expires and Max-Age capped at 400 days

Sources

How well checked: Checked against real behavior.

On this page