Bug 1770881 - Mapping active logins to privacy.clearOnShutdown.sessions instead of -session . r=pbz
Differential Revision:
https://phabricator.services.mozilla.com/D147130
--- a/netwerk/cookie/CookieService.cpp
+++ b/netwerk/cookie/CookieService.cpp
@@ -59,17 +59,17 @@ void MigrateCookieLifetimePrefs() {
return;
}
if (!mozilla::Preferences::GetBool("privacy.sanitize.sanitizeOnShutdown")) {
mozilla::Preferences::SetBool("privacy.sanitize.sanitizeOnShutdown", true);
// To avoid clearing categories that the user did not intend to clear
mozilla::Preferences::SetBool("privacy.clearOnShutdown.history", false);
mozilla::Preferences::SetBool("privacy.clearOnShutdown.formdata", false);
mozilla::Preferences::SetBool("privacy.clearOnShutdown.downloads", false);
- mozilla::Preferences::SetBool("privacy.clearOnShutdown.session", false);
+ mozilla::Preferences::SetBool("privacy.clearOnShutdown.sessions", false);
mozilla::Preferences::SetBool("privacy.clearOnShutdown.siteSettings",
false);
}
mozilla::Preferences::SetBool("privacy.clearOnShutdown.cookies", true);
mozilla::Preferences::SetBool("privacy.clearOnShutdown.cache", true);
mozilla::Preferences::SetBool("privacy.clearOnShutdown.offlineApps", true);
mozilla::Preferences::ClearUser("network.cookie.lifetimePolicy");
}
--- a/netwerk/cookie/test/unit/test_migrateCookieLifetimePref.js
+++ b/netwerk/cookie/test/unit/test_migrateCookieLifetimePref.js
@@ -14,16 +14,17 @@ add_task(async function migrateSanitizat
"network.cookie.lifetimePolicy",
Ci.nsICookieService.ACCEPT_SESSION
);
Services.prefs.setBoolPref("privacy.sanitize.sanitizeOnShutdown", false);
Services.prefs.setBoolPref("privacy.clearOnShutdown.cache", false);
Services.prefs.setBoolPref("privacy.clearOnShutdown.cookies", false);
Services.prefs.setBoolPref("privacy.clearOnShutdown.offlineApps", false);
Services.prefs.setBoolPref("privacy.clearOnShutdown.downloads", true);
+ Services.prefs.setBoolPref("privacy.clearOnShutdown.sessions", true);
// The migration code is called in cookieService::Init
Services.cookies;
Assert.equal(
Services.prefs.getIntPref("network.cookie.lifetimePolicy"),
Ci.nsICookieService.ACCEPT_NORMALLY,
"Cookie lifetime policy is off"
@@ -48,13 +49,17 @@ add_task(async function migrateSanitizat
Services.prefs.getBoolPref("privacy.clearOnShutdown.offlineApps"),
"Clearing offline apps on shutdown is selected"
);
Assert.ok(
!Services.prefs.getBoolPref("privacy.clearOnShutdown.downloads"),
"Clearing downloads on shutdown is not set anymore"
);
+ Assert.ok(
+ !Services.prefs.getBoolPref("privacy.clearOnShutdown.sessions"),
+ "Clearing active logins on shutdown is not set anymore"
+ );
Services.prefs.resetPrefs();
delete Services.cookies;
});