Which about:config setting control Delete cookies and site data when Firefox is closed?
We have Firefox deployed to hundreds of workstations in a domain environment. We would like to control local site data storage, such as setting the amount of local site data storage can be used, which sites can store local data, or just have Firefox delete site data when closed.
We use Firefox .cfg file to set different options, such as this: // Set cache size limit clearPref("browser.cache.disk.capacity") lockPref("browser.cache.disk.capacity", 10240);
But we cannot find an option to control site data. Is there any configuration for controlling local site data that we can deploy to all users/installations?
Thanks!
-Mike
所有回复 (5)
For "Delete cookies and site data when Firefox is closed" it is this preference:
network.cookie.lifetimePolicy
Possible values are:
- 0 => use expiration date set by the site
- 2 => set expiration to session only
For local DOM storage, there are some storage quota preferences, but I couldn't tell you which ones would be most useful. For example, you could search for more info on these:
- dom.storage.default_quota
- dom.storage.default_site_quota
As for which sites can set storage, I think cookie permissions/exceptions also control that, but you can test.
Hi @jscher2000
Thanks for the reply. Unfortunately, the dom.storage doesn't seem to be associated with the offline site data. We had set those to the defaults of 5MB and 25MB, but some sites are storing more than 1GB.
For cookies, we actually want to keep cookies. We just want to cut down on the local site data storage, since we use roaming profiles, and Firefox is storing several GBs for many users for SharePoint, OWA, Slack, Teams, etc. We were going to just delete the files in the "storage" subfolder upon logoff, but I would prefer a native solution if one exists.
What do you think about using Sanitize at Shutdown (Clear history when Firefox closes) with just offline data storage?
It's slightly dangerous to enable without turning off the other categories. Please test carefully:
Categories:
- privacy.clearOnShutdown.cache => defaults to true, keep on true?
- privacy.clearOnShutdown.cookies => defaults to true, set to false
- privacy.clearOnShutdown.downloads => defaults to true, set to false
- privacy.clearOnShutdown.formdata ("Form & Search History") => defaults to true, set to false
- privacy.clearOnShutdown.history => defaults to true, set to false
- privacy.clearOnShutdown.offlineApps ("Offline Website Data") => defaults to false, set to true
- privacy.clearOnShutdown.openWindows => defaults to false, keep on false
- privacy.clearOnShutdown.sessions ("Active Logins") => defaults to true, set to false
- privacy.clearOnShutdown.siteSettings ("Site Preferences") => defaults to false, keep on false
Master switch:
- privacy.sanitize.sanitizeOnShutdown => defaults to false, only set to true if safe
Yeah, I actually tried that through a policies.json file located in the "%PROGRAMFILES%\Mozilla Firefox\distribution" folder, but it didn't seem to have any impact on our test systems (closing/reopening several times, but all offline storage files remained):
{
"policies": { "SanitizeOnShutdown": { "Cache": true "OfflineApps": true } }
}
See also:
- Bug 1681493 - [meta] Deprecate and remove network.cookie.lifetimePolicy
Note that you posted invalid JSON (missing comma on Cache line). You can check the about:policies page to see whether policies are active and if errors are reported.
{ "policies": { "SanitizeOnShutdown": { "Cache": true, "OfflineApps": true } } }