First party cookies
Small name and value pairs a site stores in the browser and gets back on every request.
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
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 1 | 2008-12-11 | None |
| Edge | Supported | 12 | 2015-07-29 | None |
| Firefox | Supported | 1 | 2004-11-09 | None |
| Safari | Supported | 1 | 2003-06-23 | None |
| Safari on iPhone | Supported | 1 | 2007-06-29 | None |
| Chrome on Android | Supported | 18 | 2012-06-27 | None |
| Samsung Internet | Supported | 1.0 | 2013-04-27 | None |
How a site asks for it
| API | Set-Cookie header; document.cookie; cookieStore.get() |
| Browser compat keys | http.headers.Set-Cookieapi.Document.cookieapi.CookieStore |
| How access is granted | none |
| What the user sees | None |
| Needs a secure context (HTTPS) | No |
| Needs a user gesture | No |
| How long it lasts | Session 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 back | Clear site data, browser privacy settings |
| Inside an iframe | Not listed |
Data you get
What comes back: Cookie name and value
Shape: string
How often: any request or script write
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
size | integer | bytes | up to about 4096 per cookie | exact |
lifetime | integer | days | session to 400 | exact |
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
| Type | Example | Apps |
|---|---|---|
| shopping | A store remembers your cart for a week so you can come back and check out. | Amazon |
| social | A social site keeps you signed in so you do not enter a password each day. | None named |
| games | A browser game keeps your player ID and best score between visits. | None named |
| analytics | A site counts unique visitors by giving each browser a random ID cookie. | Google Analytics |
| ads | A site stores a click ID from an ad so it can later credit the ad for a sale. | Meta, Google Ads |
| security | A bank sets a short lived cookie after login and uses it to block stolen sessions. | None named |
| news | A 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
- web.dev: SameSite cookies explained. Google explains how sites set cookies and how browsers limit them to protect against cross site misuse.
- MDN: HTTP cookies. Documents the small pieces of data a site stores in a browser and gets back on later requests.
Good uses and abuse
Legitimate uses
- Login sessions, carts, preferences
Known abuse
- Unique ID cookies joined across pages and, with sync, across sites
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 3 of 5 | How revealing the data is |
| Utility | 5 of 5 | How useful it is to honest apps |
| Friction | 0 of 5 | How much the user has to do |
| Fingerprint bits | 0 | Rough 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
Related capabilities
Related
- Third-party cookies by browser (Nov 2026). Can recognise you across sites with embedded cookies, unless your browser blocks them
- CHIPS partitioned cookies. Can keep a cookie for an embedded service, separate for each site it appears on
- Storage partitioning. Can't use the same embedded storage to recognize you across different sites
Sources
How well checked: Checked against real behavior.