SanitizeOnShutdown
Clear local data on shutdown.
SanitizeOnShutdown accepts either a boolean to clear all data types or an object to choose which data types to clear.
Items that can be selectively deleted include browsing & download history, cookies, active logins, caches, form history, and site preferences.
Compatibility
Section titled “Compatibility”| Firefox | Firefox ESR | Firefox Enterprise |
|---|---|---|
| Available since 60 | Available since 60 | Available since 149 |
Object form added in Firefox 68/ESR 68, Locked added in 74/68.6, History in Firefox 128, Exceptions in Firefox 154.
CCK2 Equivalent: N/A
OMA-URI: SanitizeOnShutdown
Preferences Affected: privacy.sanitize.sanitizeOnShutdown, privacy.clearOnShutdown.cache, privacy.clearOnShutdown.cookies, privacy.clearOnShutdown.downloads, privacy.clearOnShutdown.formdata, privacy.clearOnShutdown.history, privacy.clearOnShutdown.sessions, privacy.clearOnShutdown.siteSettings, privacy.clearOnShutdown.offlineApps, privacy.clearOnShutdown_v2.browsingHistoryAndDownloads (Firefox 128), privacy.clearOnShutdown_v2.cookiesAndStorage (Firefox 128), privacy.clearOnShutdown_v2.cache (Firefox 128), privacy.clearOnShutdown_v2.siteSettings (Firefox 128), privacy.clearOnShutdown_v2.formdata (Firefox 128)
Examples
Section titled “Examples”{ "policies": { "SanitizeOnShutdown": true }}{ "policies": { "SanitizeOnShutdown": { "Cache": true, "Cookies": true, "FormData": true, "History": false, "Sessions": true, "SiteSettings": true, "Locked": true } }}JSON schema
{ "type": [ "boolean", "object" ], "properties": { "Cache": { "type": "boolean" }, "Cookies": { "type": "boolean" }, "Downloads": { "type": "boolean" }, "FormData": { "type": "boolean" }, "History": { "type": "boolean" }, "Sessions": { "type": "boolean" }, "SiteSettings": { "type": "boolean" }, "OfflineApps": { "type": "boolean" }, "Locked": { "type": "boolean" }, "Exceptions": { "type": "array", "items": { "type": "string", "format": "uri", "pattern": "^([Ff][Ii][Ll][Ee]://.*|[Hh][Tt][Tt][Pp][Ss]?://[^/]+/?)$" } } }}Values
Section titled “Values”SanitizeOnShutdown accepts either a boolean or an object.
When set as a boolean:
- Set to
trueto clear all supported local data on shutdown. - Set to
falseto clear nothing.
When set as an object, any member omitted is treated as false, taking precedence over user settings for that data type.
Accepts one or more of the following members to clear specific data types:
CacheCookiesDownloads: Download history (Deprecated - useHistoryinstead)FormData: Form historyHistory: Browsing history, download historySessions: Active loginsSiteSettings: Site preferencesOfflineApps: Offline Website Data (Deprecated - useCookiesinstead)Locked: Prevents the user from changing these preferences.Exceptions: (Firefox 154) A list of origins (not domains) whose cookies and site data are not cleared on shutdown. You must includehttporhttps.
Windows (GPO)
Section titled “Windows (GPO)”Clear all data:
Software\Policies\Mozilla\Firefox\SanitizeOnShutdown = 0x1 | 0x0Clear specific data types:
Software\Policies\Mozilla\Firefox\SanitizeOnShutdown\Cache = 0x1 | 0x0Software\Policies\Mozilla\Firefox\SanitizeOnShutdown\Cookies = 0x1 | 0x0Software\Policies\Mozilla\Firefox\SanitizeOnShutdown\FormData = 0x1 | 0x0Software\Policies\Mozilla\Firefox\SanitizeOnShutdown\History = 0x1 | 0x0Software\Policies\Mozilla\Firefox\SanitizeOnShutdown\Sessions = 0x1 | 0x0Software\Policies\Mozilla\Firefox\SanitizeOnShutdown\SiteSettings = 0x1 | 0x0Software\Policies\Mozilla\Firefox\SanitizeOnShutdown\Locked = 0x1 | 0x0Software\Policies\Mozilla\Firefox\SanitizeOnShutdown\Exceptions\1 = "https://example.com"Clear all data:
<dict> <key>SanitizeOnShutdown</key> <true/> | <false/></dict>Clear specific data types:
<dict> <key>SanitizeOnShutdown</key> <dict> <key>Cache</key> <true/> | <false/> <key>Cookies</key> <true/> | <false/> <key>FormData</key> <true/> | <false/> <key>History</key> <true/> | <false/> <key>Sessions</key> <true/> | <false/> <key>SiteSettings</key> <true/> | <false/> <key>Locked</key> <true/> | <false/> <key>Exceptions</key> <array> <string>https://example.com</string> </array> </dict></dict>