Firefox cookies deleted when firefox closes - managing exceptions

Hi,

I’m working through migrating my dots to Nixos / home-manager. Currently working on configuring Firefox. So far so good I have almost everything I need configured as I want beside just one thing I can’t find any reference for how to manage.

My cookie settings are set to clear when Firefox closes and in addition to this I have a list of sites considered “exceptions” meaning, these sites are allowed to store cookies. I’ve always manually maintained this list (settings → manage cookie exceptions → manually enter the sites one by one) Since I use many machines, you can see how this can become boring populating this list every time I build a new system.

Firefox profiles doesn’t help here either since while it syncs the “clear cookies on exit” setting, it doesn’t sync the exception list.

Asking the Mozilla community directly resulted in them pointing to documentation on how to backup and restore my profile, which wasn’t really much help if I’m honest.

Does anyone have any idea if this is possible? I can’t see any reference to maintaining an exception list even outside of the Nixos ecosystem. Perfect world would be to have this list as part of a property set inside my nix config.

Any help appreciated!

Thanks

1 Like

you can set policies for firefox with home-manager

{ ... }:
{
  programs.firefox = {
    enable = true;
    policies = {
      DisableTelemetry = true;
      DisableFirefoxStudies = true;
      EnableTrackingProtection = {
        Value = true;
        Locked = true;
        Cryptomining = true;
        Fingerprinting = true;
      };
      Cookies = {
        ExpireAtSessionEnd = true;
      };
      DisablePocket = true;
      DisableFirefoxAccounts = true;
      DisableAccounts = true;
      ExtensionSettings = {
        "*".installation_mode = "blocked"; # blocks all addons except the ones specified below
        # uBlock Origin:
        "uBlock0@raymondhill.net" = {
          install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
          installation_mode = "force_installed";
        };
      };
    };
  };
}

for example
you can pick and choose your options from this list
and this is what I think you want policy-templates | Policy Templates for Firefox

OP is aware of that feature and they want to manage exceptions to the feature.

Your links do not provide info on how to manage exceptions, only how to turn the entire feature on and off.