Skip to content

Commit 31ba643

Browse files
committed
Address comments from review + add YouTube cookies note + add pointers to gid and sql files
1 parent 9927929 commit 31ba643

2 files changed

Lines changed: 48 additions & 24 deletions

File tree

src/config/contributors.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5141,5 +5141,18 @@
51415141
]
51425142
},
51435143
"twitter": "_cybai"
5144+
},
5145+
"martinakraus": {
5146+
"avatar_url": "6086902",
5147+
"github": "martinakraus",
5148+
"name": "Martina Kraus",
5149+
"teams": {
5150+
"2025": [
5151+
"reviewers"
5152+
]
5153+
},
5154+
"twitter": "MartinaKraus11",
5155+
"linkedin": "martina-kraus-398493108",
5156+
"bluesky": "martinakraus11"
51445157
}
51455158
}

src/content/en/2025/cookies.md

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ title: Cookies
44
description: Cookies chapter of the 2025 Web Almanac covering the prevalence and structure of cookies on the web.
55
hero_alt: Hero image of Web Almanac characters carrying a large cookie, while crumbs are thrown off by another character. Another Web Almanac character is following the trail of cookies with a detective hat and a magnifying glass.
66
authors: [yohhaan]
7-
reviewers: [JannisBush]
7+
reviewers: [JannisBush,martinakraus]
88
analysts: [ChrisBeeti]
99
editors: []
1010
translators: []
1111
results: https://docs.google.com/spreadsheets/d/1ZirsnaXgbOMzBmt0X2eMMu3rVJvWCtQgE7pNG7fKcvc/edit
1212
yohhaan_bio: Yohan Beugin is a Ph.D. student in the Department of Computer Sciences at the University of Wisconsin–Madison where he is a member of the Security and Privacy Research Group and advised by Prof. Patrick McDaniel. He is interested in building more secure, privacy-preserving, and trustworthy systems. His current research so far has focused on tracking and privacy in online advertising as well as security of open-source software.
13-
featured_quote: TODO
13+
featured_quote: Overall, cookies remain a fundamental component of the web that continue to pose privacy and security risks for users. Both first- and third-party cookies are used for tracking, and while several web browsers (Brave, Safari, Firefox, etc.) have deprecated or limited third-party cookies, Google decided in 2025 to still support them in Chrome and deprecate most of their Privacy Sandbox proposals.
1414
featured_stat_1: 60%
1515
featured_stat_label_1: Cookies that are third-party
1616
featured_stat_2: 11%
@@ -20,8 +20,6 @@ featured_stat_label_3: Third-party cookies that are partitioned (CHIPS)
2020
doi: ...TODO
2121
---
2222

23-
{# TODO ideally resolves all todos/ideas for future iterations left in document #}
24-
2523
## Introduction
2624

2725
[Cookies](https://developer.mozilla.org/docs/Web/HTTP/Cookies) allow websites to save data and maintain state information across HTTP requests, a stateless protocol.
@@ -154,7 +152,7 @@ Below, we report on the first- and third-party split across different CrUX ranks
154152

155153
<!-- markdownlint-disable-next-line MD051 -->
156154
We observe from [Figure 2](#fig-2) and [Figure 3](#fig-3) that the most popular websites set in proportion more third-party than first-party cookies: 78% of cookies are third-party on the top 1k most visited websites when it is just below 50% on the top 10M.
157-
This may be explained by the fact that more popular websites also include more third-party content and scripts that in turns set third-party cookies to enable different functionalities.
155+
This may be explained by the fact that more popular websites also include more third-party content and scripts that in turn set third-party cookies to enable different functionalities.
158156

159157
## Cookie attributes
160158

@@ -229,19 +227,31 @@ Perhaps, this observation can be explained by a pause or reduction of adoption o
229227

230228
### `HttpOnly`
231229

232-
[`HttpOnly`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie#httponly) cookies provide some mitigation against [cross-site scripting (XSS)](https://developer.mozilla.org/docs/Glossary/Cross-site_scripting) as they can not be accessed by javascript code (but are still sent along `XMLHttpRequest` or `fetch` requests initiated from javascript).
230+
[`HttpOnly`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie#httponly) cookies provide some mitigation against [cross-site scripting (XSS)](https://developer.mozilla.org/docs/Glossary/Cross-site_scripting) as they can not be accessed by JavaScript code (but are still sent along `XMLHttpRequest` or `fetch` requests initiated from JavaScript).
233231
12% and a little more than 26% of first- and third-party cookies have this attribute set, respectively.
234232

235233
### `Secure`
236234

237-
[`Secure`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie#secure) cookies are only sent to requests made through HTTPs, same trend as last year here; while only 24% of first-party cookies set this attribute, all third-party have to set it if they want to use `SameSite=None` (which they all do, see below).
235+
[`Secure`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie#secure) cookies are only sent to requests made through HTTPS, same trend as last year here; while only 24% of first-party cookies set this attribute, all third-party cookies have to set it if they want to use `SameSite=None` (which they all do, see below).
238236

239237
### `SameSite`
240238

239+
The [`SameSite`](https://developer.mozilla.org/docs/Web/HTTP/Cookies#controlling_third-party_cookies_with_samesite) cookie attribute allows sites to specify when cookies are included with cross-site requests:
240+
- `SameSite=Strict`: a cookie is only sent in response to a request from the same site as the cookie's origin.
241+
- `SameSite=Lax`: same as `SameSite=Strict` except that the browser also sends the cookie on navigation to the cookie's origin site. On Chrome, this is the default value of `SameSite` if no value is set.
242+
- `SameSite=None`: cookies are sent on same-site or cross-site requests.
243+
This means that in order to make third-party tracking with cookies possible, the tracking cookies must have their `SameSite` attribute set to `None`.
244+
245+
To learn more about the `SameSite` attribute, see the following references:
246+
- [`SameSite` cookies explained](https://web.dev/articles/samesite-cookies-explained)
247+
- ["Same-site" and "same-origin"](https://web.dev/articles/same-site-same-origin)
248+
- [What are the parts of a URL?](https://web.dev/articles/url-parts)
249+
250+
241251
{{ figure_markup(
242252
image="same-site-desktop.png",
243253
caption="`SameSite` attribute for cookies on desktop client.",
244-
description="Shows the prevalence of the `SameSite` attribute and its value for both first-party and third-party cookies on desktop clients. 3% of first-party cookies set the `SameSite` attribute to `Strict`, 19% use `SameSite=Lax` (which is the default), 11% set the value to `None` and 66% do not specify the value of `SameSite`. Nearly 100% of third-party cookies set the `SameSite` attribute to `None`, in order for these cookies to be sent in a cross-site context.",
254+
description="Shows the prevalence of the `SameSite` attribute and its value for both first-party and third-party cookies on desktop clients. 3% of first-party cookies set the `SameSite` attribute to `Strict`, 19% use `SameSite=Lax` (which is the default on Chrome), 11% set the value to `None` and 66% do not specify the value of `SameSite`. Nearly 100% of third-party cookies set the `SameSite` attribute to `None`, in order for these cookies to be sent in a cross-site context.",
245255
chart_url="https://docs.google.com/spreadsheets/d/e/2PACX-1vSzdHAn-vwJ-Z05NYWZrImgKaX0q5D-jgWay8FD9lMDj2jr3cEjozE083JOSi6cZZX37vVD2TjEKw28/pubchart?oid=42361140&format=interactive",
246256
sheets_gid="1982273020",
247257
sql_file="prevalence_attributes_per_type.sql"
@@ -251,16 +261,15 @@ Perhaps, this observation can be explained by a pause or reduction of adoption o
251261
{{ figure_markup(
252262
image="same-site-mobile.png",
253263
caption="`SameSite` attribute for cookies on mobile client.",
254-
description="Shows the prevalence of the `SameSite` attribute and its value for both first-party and third-party cookies on mobile clients. We see very similar results as for desktop clients. 3% of first-party cookies set the `SameSite` attribute to `Strict`, 19% use `SameSite=Lax` (which is the default), 11% set the value to None and 63% do not specify the value of `SameSite`. Nearly 100% of third-party cookies set the `SameSite` attribute to `None`, in order for these cookies to be sent in a cross-site context.",
264+
description="Shows the prevalence of the `SameSite` attribute and its value for both first-party and third-party cookies on mobile clients. We see very similar results as for desktop clients. 3% of first-party cookies set the `SameSite` attribute to `Strict`, 19% use `SameSite=Lax` (which is the default on Chrome), 11% set the value to None and 63% do not specify the value of `SameSite`. Nearly 100% of third-party cookies set the `SameSite` attribute to `None`, in order for these cookies to be sent in a cross-site context.",
255265
chart_url="https://docs.google.com/spreadsheets/d/e/2PACX-1vSzdHAn-vwJ-Z05NYWZrImgKaX0q5D-jgWay8FD9lMDj2jr3cEjozE083JOSi6cZZX37vVD2TjEKw28/pubchart?oid=413420306&format=interactive",
256266
sheets_gid="1982273020",
257267
sql_file="prevalence_attributes_per_type.sql"
258268
)
259269
}}
260270

261-
For explanations about the different values for the `SameSite` attribute, we refer to the [2024 Cookies chapter](../2024/cookies#samesite).
262271
The overall distribution of this attribute for first- and third-party cookies across clients is similar to last year's: nearly 100% of third-party cookies are sent on cross-site requests (`SameSite=None`) which can enable cross-site tracking.
263-
A majority of first-party cookies (66% on desktop, 62% on mobile) do not set this attribute and so are assigned the default `Lax` behavior that 19% other first-party cookies explicitly pick, leaving only 3% setting it to the `Strict` setting, and the remaining 11% being sent on both same-site and cross-site requests (`SameSite=None`).
272+
A majority of first-party cookies (66% on desktop, 62% on mobile) do not set this attribute and so are assigned by Chrome the default `Lax` behavior that 19% other first-party cookies explicitly pick, leaving only 3% setting it to the `Strict` setting, and the remaining 11% being sent on both same-site and cross-site requests (`SameSite=None`).
264273

265274
## Cookie prefixes
266275

@@ -284,7 +293,9 @@ A majority of first-party cookies (66% on desktop, 62% on mobile) do not set thi
284293
)
285294
}}
286295

287-
Two [cookie prefixes](https://developer.mozilla.org/docs/Web/HTTP/Cookies#cookie_prefixes) `__Host-` and `__Secure-` can be used in the cookie name to indicate that they can only be set or modified by a secure HTTPs origin (for more details see the [2024 Cookies chapter](../2024/cookies#cookie-prefixes)).
296+
Both [cookie prefixes](https://developer.mozilla.org/docs/Web/HTTP/Cookies#cookie_prefixes) `__Host-` and `__Secure-` can be used in the cookie name to indicate that they can only be set or modified by a secure HTTPS origin.
297+
This is to defend against [session fixation](https://developer.mozilla.org/docs/Web/Security/Types_of_attacks#session_fixation) attacks. Cookies with both prefixes must be set by a secure HTTPS origin and have the `Secure` attribute set. Additionally, `__Host-` cookies must not contain a `Domain` attribute and have their `Path` set to `/`, thus `__Host-` cookies are only sent back to the exact host they were set on, and so not to any parent domain.
298+
288299
Here, we draw the same conclusion as last year: these prefixes have seen very low adoption on the web since their introduction 10 years ago, and so, in practice the defense-in-depth measure that they provide remains unused.
289300

290301
## Top first and third-party cookies and domains setting them
@@ -319,9 +330,9 @@ Similarly, [Figure 13](#fig-13) shows the top 10 most common third-party cookies
319330
The `IDE` and `test_cookie` cookies are set by `doubleclick.net` (owned by Google) and are present on more than 35% and 25% of websites.
320331
DoubleClick checks if a user's web browser supports third-party cookies by trying to set `test_cookie`.
321332
`MUID` from Microsoft comes next, present on more than 23% of websites, and is also used for targeted advertising and cross-site tracking.
322-
As already pointed out in the [`Partitioned` cookies](#partitioned-chips-proposal) section, this year we do not observe anymore the `YSC` and `VISITOR_INFO1_LIVE` from YouTube among top third-party cookies.
323333

324-
{# TODO would be nice to investigate a little more what is behind youtube not using these anymore and maybe be able to say more here #}
334+
As already pointed out in the [`Partitioned` cookies](#partitioned-chips-proposal) section, this year we do not observe anymore the `YSC` and `VISITOR_INFO1_LIVE` from YouTube among top third-party cookies.
335+
Note that this is likely due to changes from YouTube (perhaps linked to Google's announcements such as [this one](https://privacysandbox.google.com/blog/privacy-sandbox-next-steps) on the Privacy Sandbox proposals), since the 2024 analysis, on how and when cookies are set for YouTube videos embedded on other websites. It appears that these cookies are not set anymore when the embedding page is just loaded and the video has not been played. Additionally, [Google's Privacy & Terms](https://policies.google.com/technologies/cookies?hl=en-US) also document that `VISITOR_INFO1_LIVE` is being replaced by a `__Secure-YNID` cookie.
325336

326337
{{ figure_markup(
327338
image="top-cookie-domains.png",
@@ -394,7 +405,7 @@ Google's coverage (`doubleclick.net`, `google.com`, and `youtube.com`) is reachi
394405
</tr>
395406
</tbody>
396407
</table>
397-
<figcaption>{{ figure_link(caption="Statistics for number of cookies set on desktop pages.") }}</figcaption>
408+
<figcaption>{{ figure_link(caption="Statistics for number of cookies set on desktop pages.", sheets_gid="1535389309", sql_file="nb_cookies_quantiles.sql") }}</figcaption>
398409
</figure>
399410

400411
<figure>
@@ -452,14 +463,14 @@ Google's coverage (`doubleclick.net`, `google.com`, and `youtube.com`) is reachi
452463
</tr>
453464
</tbody>
454465
</table>
455-
<figcaption>{{ figure_link(caption="Statistics for number of cookies set on mobile pages.") }}</figcaption>
466+
<figcaption>{{ figure_link(caption="Statistics for number of cookies set on mobile pages.", sheets_gid="1535389309", sql_file="nb_cookies_quantiles.sql") }}</figcaption>
456467
</figure>
457468

458469
Websites set a median of 9 cookies of any type overall, 7 or 6 first-party cookies, and 7 or 4 third-party cookies for desktop and mobile devices, respectively.
459470
The tables above report several other statistics about the number of cookies observed per website and the figures below display their cumulative distribution functions (cdf).
460471
For example: on desktop a maximum of 178 first-party and 885 third-party cookies are set per website.
461472

462-
{# TODO: if any other idea of what to say here, feel free to add #}
473+
{# TODO: if any other idea, feel free to add #}
463474

464475
{{ figure_markup(
465476
image="number-cookies-cdf-desktop.png",
@@ -538,7 +549,7 @@ For example: on desktop a maximum of 178 first-party and 885 third-party cookies
538549
</tr>
539550
</tbody>
540551
</table>
541-
<figcaption>{{ figure_link(caption="Statistics for size of cookies set on desktop pages.") }}</figcaption>
552+
<figcaption>{{ figure_link(caption="Statistics for size of cookies set on desktop pages.", sheets_gid="1499552173", sql_file="size_cookies_quantiles.sql") }}</figcaption>
542553
</figure>
543554

544555
<figure>
@@ -596,13 +607,13 @@ For example: on desktop a maximum of 178 first-party and 885 third-party cookies
596607
</tr>
597608
</tbody>
598609
</table>
599-
<figcaption>{{ figure_link(caption="Statistics for size of cookies set on mobile pages.") }}</figcaption>
610+
<figcaption>{{ figure_link(caption="Statistics for size of cookies set on mobile pages.", sheets_gid="1499552173", sql_file="size_cookies_quantiles.sql") }}</figcaption>
600611
</figure>
601612

602613
We find that the median size of cookies across all observed cookies is 40 bytes and with a maximum of 4K bytes which is consistent with the limits defined in <a hreflang="en" href="https://datatracker.ietf.org/doc/html/rfc6265#section-6.1">RFC 6265</a>.
603614
Similar to last year, we observe some cookies that are of a single byte in size, these are likely set by error by empty `Set-Cookie` headers.
604615

605-
{# TODO: if any other idea of what to say here, feel free to add #}
616+
{# TODO: if any other idea, feel free to add #}
606617

607618
{{ figure_markup(
608619
image="size-cookies-cdf-desktop-mobile.png",
@@ -617,7 +628,7 @@ Similar to last year, we observe some cookies that are of a single byte in size,
617628
<!-- markdownlint-disable-next-line MD051 -->
618629
[Figure 17](#fig-17) corresponds to the cumulative distribution function (cdf) of the size of all the cookies seen on the top 1M websites for each client.
619630

620-
{# TODO: if any other idea of what to say here, feel free to add #}
631+
{# TODO: if any other idea, feel free to add #}
621632

622633
## Persistence (expiration)
623634

@@ -676,7 +687,7 @@ Similar to last year, we observe some cookies that are of a single byte in size,
676687
</tr>
677688
</tbody>
678689
</table>
679-
<figcaption>{{ figure_link(caption="Statistics for age of cookies set on desktop pages.") }}</figcaption>
690+
<figcaption>{{ figure_link(caption="Statistics for age of cookies set on desktop pages.", sheets_gid="718820729", sql_file="age_expire_cookies_quantiles.sql") }}</figcaption>
680691
</figure>
681692

682693

@@ -735,15 +746,15 @@ Similar to last year, we observe some cookies that are of a single byte in size,
735746
</tr>
736747
</tbody>
737748
</table>
738-
<figcaption>{{ figure_link(caption="Statistics for age of cookies set on mobile pages.") }}</figcaption>
749+
<figcaption>{{ figure_link(caption="Statistics for age of cookies set on mobile pages.", sheets_gid="718820729", sql_file="age_expire_cookies_quantiles.sql") }}</figcaption>
739750
</figure>
740751

741752
Cookies are set to an expiration date when they are created.
742753
If session cookies expire immediately after the session is over ([see previous section](#session)), most first- and third-party cookies do not and have a median age of a full year.
743754
The longer cookies live, the longer they can be used for re-identification or cross-site tracking which is why most tracking cookies are typically set to be stored in the browser for a longer time.
744755
The maximum age among the cookies that we can observe with the instrumentation and collection of the HTTP Archive Tools for this chapter is of 400 days, due to the [hard limits](https://developer.chrome.com/blog/cookie-max-age-expires) that Chrome imposes on cookie `Expires` and `Max-Age` attribute.
745756

746-
{# TODO: if any other idea of what to say here, feel free to add #}
757+
{# TODO: if any other idea, feel free to add #}
747758

748759
{# TODO (or idea for future): check the issue tab data of Chrome devtools and/or the console warnings related to cookies, data is normally collected in HTTP Archive. There could be a dedicated section in this chapter about it #}
749760

0 commit comments

Comments
 (0)