CDNs with the greatest percentage of SameSite Cookies

Hi @slane. It looks like your query is JOINing the summary_pages table to identify the CDN, and the requests table to extract the cookie details. You may want to use the _cdn_provider column in the summary_requests table instead - since that will tell you the CDN that served the request (rather than the CDN that served the base HTML).

I wrote an analysis on SameSite cookies a few weeks ago, which you can read here - SameSite Cookies Analysis. I didn’t include CDN analysis in that, but I did extract all of the cookies for the June 2020 dataset into a separate table for anaysis. That table might be useful to you for this as well.

The table httparchive.scratchspace.2020_06_01_mobile_set_cookies contains all of the Set-Cookie headers for every single request. I would avoid counting the occurances from this since there are often multiple cookies set on a single request. However you can count the distinct request urls to get a feel for whether a SameSite cookie was set.

Here’s an example of a query counting the requests with a SameSite cookie per CDN. Note that I’m using my scratchspace cookies table, JOINing the summary_requests table, and counting the distinct urls. (processes 73GB)

SELECT 
 _cdn_provider,
 COUNT(DISTINCT summary_requests.url) AS samesite_cookies
FROM 
`httparchive.scratchspace.2020_06_01_mobile_set_cookies` AS cookies
INNER JOIN
  `httparchive.summary_requests.2020_06_01_mobile` AS summary_requests
ON NET.HOST(page) = NET.HOST(summary_requests.url)
WHERE 
  LOWER(set_cookie) LIKE "%samesite%"
GROUP BY 
  _cdn_provider
ORDER BY samesite_cookies DESC

This gives you number of requests, but not %s. You’d need the number of requests served by each CDN to do that comparison. For that I would run the following (processes 2.8GB):

SELECT 
 _cdn_provider,
 COUNT(*) AS requests
FROM 
  `httparchive.summary_requests.2020_06_01_mobile` AS summary_requests
GROUP BY 
  _cdn_provider
ORDER BY requests DESC

Then combine the results and calculate the %s. I did this and you can see the results below

Hope that helps with your analysis.

1 Like