Skip to content

ClearOnShutdown

Clear browsing data when the browser closes.

This policy reflects the categories that users see in Firefox Settings: browsing & download history, cookies and site data, temporary cached files and pages, saved form info, and site settings.

This policy supersedes SanitizeOnShutdown and when both are set, SanitizeOnShutdown is ignored and Firefox logs an error. Unlike SanitizeOnShutdown, only the categories an admin defines through policy are enforced. Omitted categories are under the user's control rather than being disabled.

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

  • Set to true to clear every data category on shutdown.
  • Set to false to enforce that nothing is cleared on shutdown. Users cannot turn data clearing back on.

When set as an object, clearing on shutdown is turned on and each named member is locked to the value in the policy. Accepts one or more of the following members:

  • BrowsingHistoryAndDownloads: Browsing and download history
  • CookiesAndStorage: Cookies, site data and active logins
  • Cache: Temporary cached files and pages
  • FormData: Saved form and search entries
  • SiteSettings: Site permissions and preferences
  • Exceptions: A list of origins (not domains) whose cookies and site data are not cleared on shutdown. You must include http or https.
policies.json
{
"policies": {
"ClearOnShutdown": false
}
}
policies.json
{
"policies": {
"ClearOnShutdown": {
"BrowsingHistoryAndDownloads": true,
"CookiesAndStorage": true,
"Cache": true,
"Exceptions": [
"https://example.com"
]
}
}
}
JSON schema
ClearOnShutdown JSON schema
{
"type": [
"boolean",
"object"
],
"properties": {
"BrowsingHistoryAndDownloads": {
"type": "boolean"
},
"CookiesAndStorage": {
"type": "boolean"
},
"Cache": {
"type": "boolean"
},
"FormData": {
"type": "boolean"
},
"SiteSettings": {
"type": "boolean"
},
"Exceptions": {
"type": "array",
"items": {
"type": "string",
"format": "uri",
"pattern": "^([Ff][Ii][Ll][Ee]://.*|[Hh][Tt][Tt][Pp][Ss]?://[^/]+/?)$"
}
}
}
}

Clear all data:

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

Clear specific data types:

Software\Policies\Mozilla\Firefox\ClearOnShutdown\BrowsingHistoryAndDownloads = 0x1 | 0x0
Software\Policies\Mozilla\Firefox\ClearOnShutdown\CookiesAndStorage = 0x1 | 0x0
Software\Policies\Mozilla\Firefox\ClearOnShutdown\Cache = 0x1 | 0x0
Software\Policies\Mozilla\Firefox\ClearOnShutdown\FormData = 0x1 | 0x0
Software\Policies\Mozilla\Firefox\ClearOnShutdown\SiteSettings = 0x1 | 0x0
Software\Policies\Mozilla\Firefox\ClearOnShutdown\Exceptions\1 = "https://example.com"

Clear all data:

<dict>
<key>ClearOnShutdown</key>
<true/> | <false/>
</dict>

Clear specific data types:

<dict>
<key>ClearOnShutdown</key>
<dict>
<key>BrowsingHistoryAndDownloads</key>
<true/> | <false/>
<key>CookiesAndStorage</key>
<true/> | <false/>
<key>Cache</key>
<true/> | <false/>
<key>FormData</key>
<true/> | <false/>
<key>SiteSettings</key>
<true/> | <false/>
<key>Exceptions</key>
<array>
<string>https://example.com</string>
</array>
</dict>
</dict>
FirefoxFirefox ESRFirefox Enterprise
Available since 158Not supportedAvailable since 158

CCK2 Equivalent: N/A
Preferences Affected: privacy.sanitize.sanitizeOnShutdown, privacy.clearOnShutdown_v2.browsingHistoryAndDownloads, privacy.clearOnShutdown_v2.cookiesAndStorage, privacy.clearOnShutdown_v2.cache, privacy.clearOnShutdown_v2.formdata, privacy.clearOnShutdown_v2.siteSettings