Bug 1770881 - Mapping active logins to privacy.clearOnShutdown.sessions instead of -session . r=pbz default tip
authorHannah Peuckmann <hpeuckmann@mozilla.com>
Tue, 24 May 2022 17:37:53 +0000
changeset 618784 b7d2e0ecff91b101af8b582ad3a2540489038b93
parent 618783 131ca162afaf320677bdc60e12aab1f8bdd89429
push id163418
push userhpeuckmann@mozilla.com
push dateTue, 24 May 2022 17:40:18 +0000
treeherderautoland@b7d2e0ecff91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbz
bugs1770881
milestone102.0a1
Bug 1770881 - Mapping active logins to privacy.clearOnShutdown.sessions instead of -session . r=pbz Differential Revision: https://phabricator.services.mozilla.com/D147130
netwerk/cookie/CookieService.cpp
netwerk/cookie/test/unit/test_migrateCookieLifetimePref.js
--- 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;
 });