How Firefox Cookie Clearing Site Exceptions Work
This article explains the mechanics of site exceptions when using the automatic cookie and site data clearing feature in the Mozilla Firefox web browser. By understanding how Firefox prioritizes user-defined rules over global privacy settings, you can maintain a high level of privacy by wiping general browsing data upon closing the browser while staying logged into your most trusted websites. We will cover how the exception list overrides the auto-clear function, the different types of permission states, how to configure these settings, and how to avoid common conflicts with other browser history settings.
The Core Mechanism: Global Rules vs. Exceptions
When you enable the "Delete cookies and site data when Firefox is closed" setting, you are applying a global rule to the browser. By default, this treats every browsing session as temporary, wiping all local storage, login states, and site preferences the moment you exit Firefox.
Site exceptions act as a whitelist that overrides this global rule. When you add a specific website to the Exceptions list and set its status to "Allow," Firefox flags that domain's data as persistent. When the browser closes and runs its cleanup routine, it checks the database of stored cookies against your exception list. Any data matching a whitelisted domain is bypassed during the deletion process, keeping you logged in and preserving your site preferences for your next session.
Types of Exception Rules
When managing exceptions in Firefox, you can assign one of three statuses to a website. Here is how each interacts with the automatic clearing feature:
- Allow: This is the standard exception. The website is permitted to store cookies and site data on your device permanently. The automatic clearing feature will completely ignore this site's data when Firefox closes.
- Allow for Session: The website can store cookies and data, but Firefox will delete it when the browser closes. If you already have automatic cookie clearing enabled globally, this rule is redundant, as it performs the exact same action.
- Block: The website is completely prevented from storing any cookies or site data on your device, even while you are actively browsing it.
Subdomains and Cross-Site Data
When you add an exception for a base domain (for example,
https://example.com), Firefox automatically applies this
exception to its subdomains (such as mail.example.com or
account.example.com). However, the rule is strictly tied to
the protocol you specify; an exception for http:// will not
automatically apply to https://, though typing just the
domain name into the exception manager will usually create rules for
both.
Furthermore, Firefox utilizes Total Cookie Protection, which confines
cookies to the site where they were created. If you add
example.com to your exceptions list, third-party trackers
embedded on example.com cannot use that exception to track
you across other websites that are not on your exception list.
How to Configure Site Exceptions
To set up automatic clearing with exceptions, follow these steps:
- Open Firefox, click the menu button in the top-right corner, and select Settings.
- Click on Privacy & Security in the left-hand menu.
- Scroll down to the Cookies and Site Data section.
- Check the box for Delete cookies and site data when Firefox is closed.
- Click the Manage Exceptions... button located directly to the right of that setting.
- In the address field, type the exact URL of the website you want to keep data for.
- Click Allow, then click Save Changes at the bottom of the prompt.
Alternatively, you can add an exception while actively visiting a
website by pressing Ctrl + I (on Windows/Linux) or
Cmd + I (on macOS) to open the Page Info window, navigating
to the Permissions tab, unchecking "Use Default" under
Set Cookies, and selecting Allow.
Avoiding Conflicts with History Settings
A common issue users face is having their exception list ignored when Firefox closes. This happens when a secondary setting in the History section conflicts with the Cookies and Site Data section.
If you scroll down to the History section in your Privacy & Security settings and have Firefox set to "Use custom settings for history," you will see a checkbox for Clear history when Firefox closes. If you enable this and click the Settings... button next to it, ensure that Cookies and Offline Website Data are unchecked, or ensure you are using an updated version of Firefox that merges these rules. In older versions of Firefox, checking "Cookies" in the History clearing settings acts as a master wipe, deleting everything upon exit and ignoring the exceptions you configured in the Cookies and Site Data section.