Skip to content

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.

FirefoxFirefox ESRFirefox Enterprise
Available since 60Available since 60Available 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)

policies.json
{
"policies": {
"SanitizeOnShutdown": true
}
}
policies.json
{
"policies": {
"SanitizeOnShutdown": {
"Cache": true,
"Cookies": true,
"FormData": true,
"History": false,
"Sessions": true,
"SiteSettings": true,
"Locked": true
}
}
}
JSON schema
SanitizeOnShutdown 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]?://[^/]+/?)$"
}
}
}
}

SanitizeOnShutdown accepts either a boolean or an object. When set as a boolean:

  • Set to true to clear all supported local data on shutdown.
  • Set to false to 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:

  • Cache
  • Cookies
  • Downloads: Download history (Deprecated - use History instead)
  • FormData: Form history
  • History: Browsing history, download history
  • Sessions: Active logins
  • SiteSettings: Site preferences
  • OfflineApps: Offline Website Data (Deprecated - use Cookies instead)
  • 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 include http or https.

Clear all data:

Software\Policies\Mozilla\Firefox\SanitizeOnShutdown = 0x1 | 0x0

Clear specific data types:

Software\Policies\Mozilla\Firefox\SanitizeOnShutdown\Cache = 0x1 | 0x0
Software\Policies\Mozilla\Firefox\SanitizeOnShutdown\Cookies = 0x1 | 0x0
Software\Policies\Mozilla\Firefox\SanitizeOnShutdown\FormData = 0x1 | 0x0
Software\Policies\Mozilla\Firefox\SanitizeOnShutdown\History = 0x1 | 0x0
Software\Policies\Mozilla\Firefox\SanitizeOnShutdown\Sessions = 0x1 | 0x0
Software\Policies\Mozilla\Firefox\SanitizeOnShutdown\SiteSettings = 0x1 | 0x0
Software\Policies\Mozilla\Firefox\SanitizeOnShutdown\Locked = 0x1 | 0x0
Software\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>