Privacy Tools Guide

Cross-site cookie tracking remains one of the most persistent methods advertisers and data brokers use to build user profiles across the web. Firefox’s Total Cookie Protection, introduced as part of Enhanced Tracking Protection, addresses this problem by fundamentally changing how cookies are stored and accessed. This article explains the technical mechanisms behind this feature and provides practical guidance for developers and power users who want to understand or configure these protections.

To appreciate what Total Cookie Protection accomplishes, you need to understand how traditional cookie tracking operates. When you visit a website, that site can set cookies that are accessible not just to itself, but to any third party embedded on the page. A typical news site might embed content from dozens of external domains—advertising networks, analytics providers, social media widgets, and more. Each of these third parties can set cookies that persist across your entire browsing session.

The critical vulnerability is that these third-party cookies can share identifiers across sites. When you visit Site An and Site B, both loading content from the same advertising network, that network can recognize you as the same visitor by reading the same cookie it set earlier. This allows trackers to construct browsing histories that span thousands of sites, building detailed profiles of user behavior, interests, and demographics.

Traditional browser privacy settings often attempted to block third-party cookies entirely. However, this approach frequently broke legitimate website functionality—single sign-on systems, embedded content, and payment processing often rely on cross-site cookie access. The result was a perpetual arms race where users had to choose between privacy and functionality.

Firefox Total Cookie Protection takes a fundamentally different approach. Rather than simply blocking third-party cookies, it creates isolated cookie jars for each website. When you visit example.com, any cookies set by embedded third parties are stored in a separate, restricted container specific to example.com. These cookies cannot be accessed when you visit other sites, even if those sites include the same third-party content.

This isolation happens at the browser level without requiring any user configuration. Firefox automatically detects when content from another domain is embedded on a page and routes cookie storage accordingly. The user experiences normal website functionality while trackers lose their ability to correlate behavior across sites.

The technical implementation works by partitioning cookies based on the top-level site context. When your browser makes a request to a third-party resource, Firefox associates any resulting cookies with the top-level URL rather than the third-party domain. This means advertising network cookies set on news-site-a.com remain inaccessible when you visit news-site-b.com, even though both pages load content from the same advertising network.

For developers who want to verify that cookie isolation is working, you can test this behavior directly. Create two simple HTML files on different domains or use a testing setup with local hosts entries pointing to different subdomain configurations.

Consider this test scenario: Create a page on domain-a.com that includes an iframe loading content from tracker.example. Set a cookie through the iframe, then attempt to read that cookie from domain-b.com with an iframe from the same tracker domain. With Total Cookie Protection enabled, the cookie set in the first context will not be available in the second.

You can also verify this using browser developer tools. Open the Storage Inspector in Firefox (Storage tab in Developer Tools) and observe how cookies appear grouped by their owning site rather than by domain. Each top-level site maintains its own cookie container, and cookies from embedded third parties appear under the top-level site’s storage rather than under their native domain.

Configuration Options for Power Users

Firefox enables Total Cookie Protection by default in Strict and Custom Enhanced Tracking Protection modes. However, you can verify your protection level or adjust settings through about:config or the browser’s privacy settings.

To check your protection level programmatically or through the browser interface, navigate to the privacy settings panel. The “Strict” preset enables all protections including Total Cookie Protection. The “Custom” preset allows you to selectively enable cookie isolation while adjusting other tracking protections.

For developers who need to test cross-site cookie behavior while maintaining protection in normal browsing, Firefox provides useful about:config preferences:

privacy.totalCookieProtection - Boolean controlling the feature (default: true in Strict mode)
privacy.trackingProtection.enabled - Master toggle for tracking protection
network.cookie.cookieBehavior - Controls cookie acceptance policy (5 = block third-party)

Setting network.cookie.cookieBehavior to 5 enables Total Cookie Protection along with other tracking protections. Values below 5 represent progressively less restrictive cookie policies, with 0 allowing all cookies and 1-4 providing various levels of blocking.

Total Cookie Protection works alongside other Firefox privacy features to provide tracking defense. It complements Enhanced Tracking Protection’s blocking of known trackers, SmartBlock’s handling of first-party fallbacks, and the containerization system used by Firefox Multi-Account Containers.

The relationship with First-Party Isolation (FPI) is worth noting. FPI, an earlier privacy mechanism in Firefox, also partitioned cookies by top-level domain but with different implementation details. Total Cookie Protection supersedes FPI in terms of tracking prevention effectiveness while maintaining better compatibility with legitimate website features. If you encounter sites that worked with FPI but break under Total Cookie Protection, you can report these as compatibility issues to Firefox developers.

For users who need to maintain logged-in sessions across related sites—such as subdomains of the same service—Total Cookie Protection handles this correctly. The isolation applies to third-party embedded content, while same-site cookies (matching the top-level domain) continue functioning normally.

Practical Implications for Web Developers

If you develop web applications, understanding cookie isolation helps you design more privacy-respecting systems. Rather than relying on third-party cookies for tracking users across sites, modern approaches include:

First-party analytics that processes data on your own servers without sharing identifiers with third parties. User-centric identifiers stored only on user devices through localStorage or IndexedDB with explicit user consent. Privacy-preserving analytics APIs that aggregate data server-side without exposing individual browsing histories.

For authentication systems that previously relied on third-party cookies, consider implementing authentication flows that use redirect-based token passing rather than cookie sharing across domains. OAuth 2.0 and OpenID Connect protocols work well within cookie isolation constraints because they pass tokens through URL parameters and server-side exchanges rather than cross-site cookie access.

Limitations and Considerations

While Total Cookie Protection significantly reduces cross-site tracking, it does not prevent all forms of tracking. Browser fingerprinting—collecting device characteristics like screen resolution, installed fonts, and WebGL capabilities—remains possible even with cookie isolation. Firefox includes fingerprinting protection in its Enhanced Tracking Protection, but sophisticated fingerprinting techniques can still partially identify users.

Supercookies and other storage mechanisms like ETags, cache timing, and HSTS supercookies operate outside the cookie system entirely. Firefox’s Total Cookie Protection specifically targets HTTP cookies and does not automatically block these alternative tracking vectors.

Network-level tracking, where ISPs or network observers log DNS queries and traffic patterns, also bypasses browser-level cookie protections. Users concerned about network-level tracking need to combine browser privacy features with DNS-over-HTTPS configuration or VPN services.

Threat Model: Tracking Scenarios Prevented

Understanding what Total Cookie Protection protects against helps you evaluate whether your configuration meets your privacy needs:

Behavioral Profile Building: Without partitioning, advertisers track you across dozens of sites—your reading habits, shopping interests, political views, health concerns—building a behavioral profile. With TCP, each site’s third parties see only what you do on that specific site. A fashion retailer cannot see that you visit health symptom checkers.

Cross-Domain Fingerprinting: Trackers combine cookies with other identifiers (canvas fingerprinting, IP addresses) to recognize you across sites. TCP prevents the cookie component of this attack, though browser fingerprinting remains effective.

Remarketing Escape: Advertisers use cookies to follow you after you leave their site, showing you relevant ads everywhere else. TCP breaks this mechanism—advertisers cannot build persistent audiences across unrelated sites.

Identity Resolution: Data brokers purchase cookies from tracking networks to match user identifiers across sites, creating unified profiles from multiple sources. TCP prevents trackers from sharing identifiers across different browsing contexts.

Create a practical test to verify cookie isolation works on your browser:

Test Setup: Open two browser tabs to different websites:

Both sites likely load analytics from Google Analytics, but with TCP enabled, the Google Analytics cookies in Tab A cannot be read in Tab B, even though both pages load Google Analytics code.

Verification Steps:

  1. Open Firefox Developer Tools (F12) on Tab A
  2. Go to Storage → Cookies → Find the domain that ends in “.google.com”
  3. Note the cookies present (typically “_ga”, “_gid”, or similar)
  4. Switch to Tab B and repeat the process
  5. Observe that the cookies are different—the same tracking domain has separate cookies in each context

Browser Console Verification: In Developer Tools Console, you can verify isolation:

// In Tab A with reddit.com loaded
// This will show Google Analytics cookies for the reddit.com context
document.cookie;

// Note the cookies, then switch to Tab B with ycombinator.com
// The same command will show different cookies for the ycombinator.com context
document.cookie;

Advanced Testing: Create test pages on different local domains:

<!-- Save as test-a.local -->
<html>
<body>
  <h1>Site A - Check Storage Inspector</h1>
  <iframe src="https://tracker.example.com/set-cookie.html"></iframe>
  <script>
    console.log("Cookies in Site A context:", document.cookie);
  </script>
</body>
</html>

The tracker.example.com iframe will set cookies that are isolated to test-a.local’s context.

Configuration Deep Dive

Beyond the default settings, Firefox offers granular controls for power users:

about:config Settings:

privacy.isolation.forceStrictStoragePartitioning = true
  # Forces strict partitioning across all storage types (cookies, localStorage, IndexedDB)

privacy.trackingprotection.enabled = true
  # Enables basic tracking protection

privacy.trackingprotection.socialtracking.enabled = true
  # Blocks trackers categorized as social networks

privacy.trackingprotection.cryptomining.enabled = true
  # Blocks cryptomining scripts

network.cookie.cookieBehavior = 5
  # 0 = Accept all cookies
  # 1 = Reject third-party cookies
  # 2 = Accept only from visited sites
  # 3 = Reject all cookies
  # 4 = Reject tracking cookies
  # 5 = Reject tracking and third-party (highest privacy)

network.cookie.sameSite.laxByDefault = true
  # Makes SameSite=Lax the default for cookies without explicit SameSite attribute

Verification Command: Check your current privacy settings:

// In Firefox console, check the privacy settings
navigator.doNotTrack  // Returns "1" if DNT is enabled

// Check cookie behavior setting
// Go to about:preferences#privacy and look for "Strict" mode indicator

Storage Partitioning Beyond Cookies

Total Cookie Protection also affects other storage mechanisms:

localStorage and sessionStorage: These are now partitioned per-site, meaning trackers cannot store identifiers in localStorage that persist across different sites.

IndexedDB: Similarly partitioned, preventing cross-site IndexedDB access. This affects applications that use IndexedDB for client-side data storage.

Cache Partitioning: HTTP cache is also partitioned by the top-level site, preventing trackers from detecting your previous visits through cache timing attacks.

Testing localStorage Isolation:

// On site-a.example.com
localStorage.setItem("tracker_id", "abc123");

// This data is isolated to site-a.example.com
// When you visit site-b.example.com, even if both load the same third-party code,
// that code cannot access the tracker_id from site-a

// You can verify this in Developer Tools → Storage → Local Storage
// You'll see separate entries for each top-level site

Interaction with Other Firefox Privacy Features

Multi-Account Containers: Combines with TCP for enhanced isolation. Containers partition storage by both site and container, creating additional context separation.

First-Party Isolation (FPI): Older privacy mechanism now superseded by TCP, but some users still enable both for maximum partitioning. FPI created entirely separate browser contexts (different dom storage IDs), while TCP uses a simpler partitioning approach.

SmartBlock: Handles compatibility issues when trackers are blocked. If a site breaks due to missing tracker functionality, SmartBlock provides a local substitute. Works alongside TCP to maintain functionality.

Practical Configuration for Different Use Cases

For Maximum Privacy:

For Balanced Privacy and Functionality:

For Developers Testing Cross-Site Behavior:

Common Implementation Mistakes

Websites that Break with TCP:

Some websites implement SSO or authentication systems that rely on third-party cookies:

Solutions:

Testing Cookie Behavior:

# Check what cookies a specific site is setting
# Monitor Firefox network tab and filter by "cookies" or specific domains

# Using curl to see Set-Cookie headers
curl -v https://example.com 2>&1 | grep -i "set-cookie"

Limitations and Complementary Protections

While TCP is, it doesn’t prevent:

Browser Fingerprinting: Canvas fingerprinting, WebGL fingerprinting, font detection, and other technique still work. Use Firefox’s fingerprinting protection (Enhanced Tracking Protection → Strict).

HSTS Supercookies: Some sites use HSTS cache to store identifiers. These bypass cookie partitioning. HSTS pinning attacks remain possible.

IP-Based Tracking: Network-level tracking using your IP address, ISP logs, or DNS queries. Combine with VPN or DNS-over-HTTPS.

First-Party Tracking: Tracking from the website you’re actually visiting isn’t prevented by TCP. Use privacy settings to minimize first-party data collection.

Built by theluckystrike — More at zovo.one