You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/en/2025/cookies.md
+35-24Lines changed: 35 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,13 @@ title: Cookies
4
4
description: Cookies chapter of the 2025 Web Almanac covering the prevalence and structure of cookies on the web.
5
5
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.
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.
14
14
featured_stat_1: 60%
15
15
featured_stat_label_1: Cookies that are third-party
16
16
featured_stat_2: 11%
@@ -20,8 +20,6 @@ featured_stat_label_3: Third-party cookies that are partitioned (CHIPS)
20
20
doi: ...TODO
21
21
---
22
22
23
-
{# TODO ideally resolves all todos/ideas for future iterations left in document #}
24
-
25
23
## Introduction
26
24
27
25
[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
154
152
155
153
<!-- markdownlint-disable-next-line MD051 -->
156
154
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.
158
156
159
157
## Cookie attributes
160
158
@@ -229,19 +227,31 @@ Perhaps, this observation can be explained by a pause or reduction of adoption o
229
227
230
228
### `HttpOnly`
231
229
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).
233
231
12% and a little more than 26% of first- and third-party cookies have this attribute set, respectively.
234
232
235
233
### `Secure`
236
234
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).
238
236
239
237
### `SameSite`
240
238
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
+
241
251
{{ figure_markup(
242
252
image="same-site-desktop.png",
243
253
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.",
@@ -251,16 +261,15 @@ Perhaps, this observation can be explained by a pause or reduction of adoption o
251
261
{{ figure_markup(
252
262
image="same-site-mobile.png",
253
263
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.",
For explanations about the different values for the `SameSite` attribute, we refer to the [2024 Cookies chapter](../2024/cookies#samesite).
262
271
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`).
264
273
265
274
## Cookie prefixes
266
275
@@ -284,7 +293,9 @@ A majority of first-party cookies (66% on desktop, 62% on mobile) do not set thi
284
293
)
285
294
}}
286
295
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
+
288
299
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.
289
300
290
301
## 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
319
330
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.
320
331
DoubleClick checks if a user's web browser supports third-party cookies by trying to set `test_cookie`.
321
332
`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.
323
333
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.
325
336
326
337
{{ figure_markup(
327
338
image="top-cookie-domains.png",
@@ -394,7 +405,7 @@ Google's coverage (`doubleclick.net`, `google.com`, and `youtube.com`) is reachi
394
405
</tr>
395
406
</tbody>
396
407
</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>
398
409
</figure>
399
410
400
411
<figure>
@@ -452,14 +463,14 @@ Google's coverage (`doubleclick.net`, `google.com`, and `youtube.com`) is reachi
452
463
</tr>
453
464
</tbody>
454
465
</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>
456
467
</figure>
457
468
458
469
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.
459
470
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).
460
471
For example: on desktop a maximum of 178 first-party and 885 third-party cookies are set per website.
461
472
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 #}
463
474
464
475
{{ figure_markup(
465
476
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
538
549
</tr>
539
550
</tbody>
540
551
</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>
542
553
</figure>
543
554
544
555
<figure>
@@ -596,13 +607,13 @@ For example: on desktop a maximum of 178 first-party and 885 third-party cookies
596
607
</tr>
597
608
</tbody>
598
609
</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>
600
611
</figure>
601
612
602
613
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 <ahreflang="en"href="https://datatracker.ietf.org/doc/html/rfc6265#section-6.1">RFC 6265</a>.
603
614
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.
604
615
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 #}
606
617
607
618
{{ figure_markup(
608
619
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,
617
628
<!-- markdownlint-disable-next-line MD051 -->
618
629
[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.
619
630
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 #}
621
632
622
633
## Persistence (expiration)
623
634
@@ -676,7 +687,7 @@ Similar to last year, we observe some cookies that are of a single byte in size,
676
687
</tr>
677
688
</tbody>
678
689
</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>
680
691
</figure>
681
692
682
693
@@ -735,15 +746,15 @@ Similar to last year, we observe some cookies that are of a single byte in size,
735
746
</tr>
736
747
</tbody>
737
748
</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>
739
750
</figure>
740
751
741
752
Cookies are set to an expiration date when they are created.
742
753
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.
743
754
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.
744
755
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.
745
756
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 #}
747
758
748
759
{# 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 #}
0 commit comments