Bug 1551798 - Rename nsICookie2.SAMESITE_UNSET to nsICookie2.SAMESITE_NONE, r=Ehsan
authorAndrea Marchesini <amarchesini@mozilla.com>
Wed, 29 May 2019 15:55:03 +0000
changeset 476082 51e4490f3e1610f428fa7c863ebd67aca345b40a
parent 476081 b31e0897ef74a390bc63e38c98e6960946e91d65
child 476083 3bff8c732fb4e011627822d2033e436273e035af
push id36084
push usershindli@mozilla.com
push dateWed, 29 May 2019 21:50:20 +0000
treeherdermozilla-central@4b3431481d55 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersEhsan
bugs1551798
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1551798 - Rename nsICookie2.SAMESITE_UNSET to nsICookie2.SAMESITE_NONE, r=Ehsan Differential Revision: https://phabricator.services.mozilla.com/D31214
browser/base/content/test/sanitize/browser_cookiePermission_subDomains.js
browser/base/content/test/sanitize/head.js
browser/components/enterprisepolicies/tests/xpcshell/test_clear_blocked_cookies.js
browser/components/extensions/test/xpcshell/test_ext_browsingData_cookies_cache.js
browser/components/migration/ChromeProfileMigrator.jsm
browser/components/migration/MSMigrationUtils.jsm
browser/components/migration/tests/marionette/test_refresh_firefox.py
browser/components/preferences/in-content/tests/siteData/browser_siteData.js
browser/components/sessionstore/SessionCookies.jsm
browser/components/sessionstore/test/browser_cookies_privacy.js
devtools/server/actors/storage.js
mobile/android/components/extensions/test/mochitest/test_ext_browsingData_cookies_cache.html
netwerk/cookie/nsCookieService.cpp
netwerk/cookie/nsICookie2.idl
netwerk/test/TestCookie.cpp
netwerk/test/mochitests/file_testloadflags_chromescript.js
netwerk/test/unit/test_bug411952.js
netwerk/test/unit/test_bug526789.js
netwerk/test/unit/test_bug650522.js
netwerk/test/unit/test_bug667087.js
netwerk/test/unit/test_cookies_async_failure.js
netwerk/test/unit/test_cookies_profile_close.js
netwerk/test/unit/test_domain_eviction.js
netwerk/test/unit/test_eviction.js
netwerk/test/unit_ipc/test_cookie_header_stripped.js
security/manager/ssl/tests/unit/test_toolkit_securityreporter.js
testing/marionette/cookie.js
toolkit/components/cleardata/SiteDataTestUtils.jsm
toolkit/components/cleardata/tests/unit/test_cookies.js
toolkit/components/contextualidentity/tests/unit/test_corruptedFile.js
toolkit/components/extensions/parent/ext-cookies.js
toolkit/components/extensions/test/mochitest/head_cookies.js
toolkit/components/extensions/test/mochitest/test_ext_cookies_expiry.html
toolkit/components/extensions/test/mochitest/test_ext_cookies_incognito.html
toolkit/forgetaboutsite/test/browser/browser_cookieDomain.js
toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js
toolkit/mozapps/extensions/test/browser/browser_html_discover_view.js
toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_langpacks.js
toolkit/mozapps/extensions/test/xpcshell/test_cookies.js
toolkit/mozapps/extensions/test/xpinstall/browser_cookies2.js
toolkit/mozapps/extensions/test/xpinstall/browser_cookies3.js
toolkit/mozapps/extensions/test/xpinstall/browser_cookies4.js
--- a/browser/base/content/test/sanitize/browser_cookiePermission_subDomains.js
+++ b/browser/base/content/test/sanitize/browser_cookiePermission_subDomains.js
@@ -17,26 +17,26 @@ add_task(async function subDomains() {
   ]});
 
   // Domains and data
   let uriA = Services.io.newURI("https://www.mozilla.org");
   Services.perms.add(uriA, "cookie", Ci.nsICookiePermission.ACCESS_SESSION);
 
   Services.cookies.add(uriA.host, "/test", "a", "b",
     false, false, false, Date.now() + 24000 * 60 * 60, {},
-    Ci.nsICookie2.SAMESITE_UNSET);
+    Ci.nsICookie2.SAMESITE_NONE);
 
   await createIndexedDB(uriA.host, {});
 
   let uriB = Services.io.newURI("https://mozilla.org");
   Services.perms.add(uriB, "cookie", Ci.nsICookiePermission.ACCESS_ALLOW);
 
   Services.cookies.add(uriB.host, "/test", "c", "d",
     false, false, false, Date.now() + 24000 * 60 * 60, {},
-    Ci.nsICookie2.SAMESITE_UNSET);
+    Ci.nsICookie2.SAMESITE_NONE);
 
   await createIndexedDB(uriB.host, {});
 
   // Check
   ok(await checkCookie(uriA.host, {}), "We have cookies for URI: " + uriA.host);
   ok(await checkIndexedDB(uriA.host, {}), "We have IDB for URI: " + uriA.host);
   ok(await checkCookie(uriB.host, {}), "We have cookies for URI: " + uriB.host);
   ok(await checkIndexedDB(uriB.host, {}), "We have IDB for URI: " + uriB.host);
@@ -71,25 +71,25 @@ add_task(async function subDomains() {
   ]});
 
   // Domains and data
   let uriA = Services.io.newURI("https://sub.mozilla.org");
   Services.perms.add(uriA, "cookie", Ci.nsICookiePermission.ACCESS_ALLOW);
 
   Services.cookies.add(uriA.host, "/test", "a", "b",
     false, false, false, Date.now() + 24000 * 60 * 60, {},
-    Ci.nsICookie2.SAMESITE_UNSET);
+    Ci.nsICookie2.SAMESITE_NONE);
 
   await createIndexedDB(uriA.host, {});
 
   let uriB = Services.io.newURI("https://www.mozilla.org");
 
   Services.cookies.add(uriB.host, "/test", "c", "d",
     false, false, false, Date.now() + 24000 * 60 * 60, {},
-    Ci.nsICookie2.SAMESITE_UNSET);
+    Ci.nsICookie2.SAMESITE_NONE);
 
   await createIndexedDB(uriB.host, {});
 
   // Check
   ok(await checkCookie(uriA.host, {}), "We have cookies for URI: " + uriA.host);
   ok(await checkIndexedDB(uriA.host, {}), "We have IDB for URI: " + uriA.host);
   ok(await checkCookie(uriB.host, {}), "We have cookies for URI: " + uriB.host);
   ok(await checkIndexedDB(uriB.host, {}), "We have IDB for URI: " + uriB.host);
--- a/browser/base/content/test/sanitize/head.js
+++ b/browser/base/content/test/sanitize/head.js
@@ -29,23 +29,23 @@ function checkIndexedDB(host, originAttr
       resolve(data);
     };
   });
 }
 
 function createHostCookie(host, originAttributes) {
   Services.cookies.add(host, "/test", "foo", "bar",
     false, false, false, Date.now() + 24000 * 60 * 60, originAttributes,
-    Ci.nsICookie2.SAMESITE_UNSET);
+    Ci.nsICookie2.SAMESITE_NONE);
 }
 
 function createDomainCookie(host, originAttributes) {
   Services.cookies.add("." + host, "/test", "foo", "bar",
     false, false, false, Date.now() + 24000 * 60 * 60, originAttributes,
-    Ci.nsICookie2.SAMESITE_UNSET);
+    Ci.nsICookie2.SAMESITE_NONE);
 }
 
 function checkCookie(host, originAttributes) {
   for (let cookie of Services.cookies.enumerator) {
     if (ChromeUtils.isOriginAttributesEqual(originAttributes,
                                             cookie.originAttributes) &&
         cookie.host.includes(host)) {
       return true;
--- a/browser/components/enterprisepolicies/tests/xpcshell/test_clear_blocked_cookies.js
+++ b/browser/components/enterprisepolicies/tests/xpcshell/test_clear_blocked_cookies.js
@@ -2,21 +2,21 @@
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 "use strict";
 
 const HOSTNAME_DOMAIN = "browser_policy_clear_blocked_cookies.com";
 const ORIGIN_DOMAIN = "browser_policy_clear_blocked_cookies.org";
 
 add_task(async function setup() {
   const expiry = Date.now() + 24 * 60 * 60;
-  Services.cookies.add(HOSTNAME_DOMAIN, "/", "secure", "true", true, false, false, expiry, {}, Ci.nsICookie2.SAMESITE_UNSET);
-  Services.cookies.add(HOSTNAME_DOMAIN, "/", "insecure", "true", false, false, false, expiry, {}, Ci.nsICookie2.SAMESITE_UNSET);
-  Services.cookies.add(ORIGIN_DOMAIN, "/", "secure", "true", true, false, false, expiry, {}, Ci.nsICookie2.SAMESITE_UNSET);
-  Services.cookies.add(ORIGIN_DOMAIN, "/", "insecure", "true", false, false, false, expiry, {}, Ci.nsICookie2.SAMESITE_UNSET);
-  Services.cookies.add("example.net", "/", "secure", "true", true, false, false, expiry, {}, Ci.nsICookie2.SAMESITE_UNSET);
+  Services.cookies.add(HOSTNAME_DOMAIN, "/", "secure", "true", true, false, false, expiry, {}, Ci.nsICookie2.SAMESITE_NONE);
+  Services.cookies.add(HOSTNAME_DOMAIN, "/", "insecure", "true", false, false, false, expiry, {}, Ci.nsICookie2.SAMESITE_NONE);
+  Services.cookies.add(ORIGIN_DOMAIN, "/", "secure", "true", true, false, false, expiry, {}, Ci.nsICookie2.SAMESITE_NONE);
+  Services.cookies.add(ORIGIN_DOMAIN, "/", "insecure", "true", false, false, false, expiry, {}, Ci.nsICookie2.SAMESITE_NONE);
+  Services.cookies.add("example.net", "/", "secure", "true", true, false, false, expiry, {}, Ci.nsICookie2.SAMESITE_NONE);
   await setupPolicyEngineWithJson({
     "policies": {
       "Cookies": {
         "Block": [
           `http://${HOSTNAME_DOMAIN}`,
           `https://${ORIGIN_DOMAIN}:8080`,
         ],
       },
--- a/browser/components/extensions/test/xpcshell/test_ext_browsingData_cookies_cache.js
+++ b/browser/components/extensions/test/xpcshell/test_ext_browsingData_cookies_cache.js
@@ -19,17 +19,17 @@ const COOKIE_NET = {
 const COOKIE_ORG = {
   host: "example.org",
   name: "test_cookie",
   path: "/",
 };
 let since, oldCookie;
 
 function addCookie(cookie) {
-  Services.cookies.add(cookie.host, cookie.path, cookie.name, "test", false, false, false, Date.now() / 1000 + 10000, {}, Ci.nsICookie2.SAMESITE_UNSET);
+  Services.cookies.add(cookie.host, cookie.path, cookie.name, "test", false, false, false, Date.now() / 1000 + 10000, {}, Ci.nsICookie2.SAMESITE_NONE);
   ok(Services.cookies.cookieExists(cookie.host, cookie.path, cookie.name, {}), `Cookie ${cookie.name} was created.`);
 }
 
 async function setUpCookies() {
   Services.cookies.removeAll();
 
   // Add a cookie which will end up with an older creationTime.
   oldCookie = Object.assign({}, COOKIE, {name: Date.now()});
--- a/browser/components/migration/ChromeProfileMigrator.jsm
+++ b/browser/components/migration/ChromeProfileMigrator.jsm
@@ -331,17 +331,17 @@ async function GetCookiesResource(aProfi
                                row.getResultByName("path"),
                                row.getResultByName("name"),
                                row.getResultByName("value"),
                                row.getResultByName(isSecure),
                                row.getResultByName(isHttponly),
                                false,
                                parseInt(expiresUtc),
                                {},
-                               Ci.nsICookie2.SAMESITE_UNSET);
+                               Ci.nsICookie2.SAMESITE_NONE);
         } catch (e) {
           Cu.reportError(e);
         }
       }
       aCallback(true);
     },
   };
 }
--- a/browser/components/migration/MSMigrationUtils.jsm
+++ b/browser/components/migration/MSMigrationUtils.jsm
@@ -635,17 +635,17 @@ Cookies.prototype = {
                            path,
                            name,
                            value,
                            Number(flags) & 0x1, // secure
                            false, // httpOnly
                            false, // session
                            expireTime,
                            {},
-                           Ci.nsICookie2.SAMESITE_UNSET);
+                           Ci.nsICookie2.SAMESITE_NONE);
     }
   },
 };
 
 function getTypedURLs(registryKeyPath) {
   // The list of typed URLs is a sort of annotation stored in the registry.
   // The number of entries stored is not UI-configurable, but has changed
   // between different Windows versions. We just keep reading up to the first
--- a/browser/components/migration/tests/marionette/test_refresh_firefox.py
+++ b/browser/components/migration/tests/marionette/test_refresh_firefox.py
@@ -136,17 +136,17 @@ class TestFirefoxRefresh(MarionetteTestC
           }).then(resolve);
         """)
 
     def createCookie(self):
         self.runCode("""
           // Expire in 15 minutes:
           let expireTime = Math.floor(Date.now() / 1000) + 15 * 60;
           Services.cookies.add(arguments[0], arguments[1], arguments[2], arguments[3],
-                               true, false, false, expireTime, {}, Ci.nsICookie2.SAMESITE_UNSET);
+                               true, false, false, expireTime, {}, Ci.nsICookie2.SAMESITE_NONE);
         """, script_args=(self._cookieHost, self._cookiePath, self._cookieName, self._cookieValue))
 
     def createSession(self):
         self.runAsyncCode("""
           let resolve = arguments[arguments.length - 1];
           const COMPLETE_STATE = Ci.nsIWebProgressListener.STATE_STOP +
                                  Ci.nsIWebProgressListener.STATE_IS_NETWORK;
           let {TabStateFlusher} = Cu.import("resource:///modules/sessionstore/TabStateFlusher.jsm", {});
--- a/browser/components/preferences/in-content/tests/siteData/browser_siteData.js
+++ b/browser/components/preferences/in-content/tests/siteData/browser_siteData.js
@@ -132,28 +132,28 @@ add_task(async function() {
 
 // Test showing and removing sites with cookies.
 add_task(async function() {
   // Add some test cookies.
   let uri = Services.io.newURI("https://example.com");
   let uri2 = Services.io.newURI("https://example.org");
   Services.cookies.add(uri.host, uri.pathQueryRef, "test1", "1",
     false, false, false, Date.now() + 1000 * 60 * 60, {},
-    Ci.nsICookie2.SAMESITE_UNSET);
+    Ci.nsICookie2.SAMESITE_NONE);
   Services.cookies.add(uri.host, uri.pathQueryRef, "test2", "2",
     false, false, false, Date.now() + 1000 * 60 * 60, {},
-    Ci.nsICookie2.SAMESITE_UNSET);
+    Ci.nsICookie2.SAMESITE_NONE);
   Services.cookies.add(uri2.host, uri2.pathQueryRef, "test1", "1",
     false, false, false, Date.now() + 1000 * 60 * 60, {},
-    Ci.nsICookie2.SAMESITE_UNSET);
+    Ci.nsICookie2.SAMESITE_NONE);
 
   // Ensure that private browsing cookies are ignored.
   Services.cookies.add(uri.host, uri.pathQueryRef, "test3", "3",
     false, false, false, Date.now() + 1000 * 60 * 60, { privateBrowsingId: 1 },
-    Ci.nsICookie2.SAMESITE_UNSET);
+    Ci.nsICookie2.SAMESITE_NONE);
 
   // Get the exact creation date from the cookies (to avoid intermittents
   // from minimal time differences, since we round up to minutes).
   let cookiesEnum1 = Services.cookies.getCookiesFromHost(uri.host, {});
   // We made two valid cookies for example.com.
   cookiesEnum1.getNext();
   let cookiesEnum2 = Services.cookies.getCookiesFromHost(uri2.host, {});
   let cookie1 = cookiesEnum1.getNext().QueryInterface(Ci.nsICookie2);
--- a/browser/components/sessionstore/SessionCookies.jsm
+++ b/browser/components/sessionstore/SessionCookies.jsm
@@ -59,17 +59,17 @@ var SessionCookiesInternal = {
         Cu.reportError(`nsCookieService::CookieExists failed with error '${ex}' for '${JSON.stringify(cookie)}'.`);
       }
       if (!exists) {
         try {
           Services.cookies.add(cookie.host, cookie.path || "", cookie.name || "",
                                cookie.value, !!cookie.secure, !!cookie.httponly,
                                /* isSession = */ true, expiry,
                                cookie.originAttributes || {},
-                               Ci.nsICookie2.SAMESITE_UNSET);
+                               Ci.nsICookie2.SAMESITE_NONE);
         } catch (ex) {
           Cu.reportError(`nsCookieService::Add failed with error '${ex}' for cookie ${JSON.stringify(cookie)}.`);
         }
       }
     }
   },
 
   /**
--- a/browser/components/sessionstore/test/browser_cookies_privacy.js
+++ b/browser/components/sessionstore/test/browser_cookies_privacy.js
@@ -4,17 +4,17 @@
 const MAX_EXPIRY = Math.pow(2, 62);
 
 function addCookie(scheme, secure = false) {
   let cookie = createTestCookie("http", secure);
   Services.cookies.add(cookie.host, cookie.path, cookie.name, cookie.value,
                        cookie.secure, /* isHttpOnly = */ false,
                        /* isSession = */ true, MAX_EXPIRY,
                        /* originAttributes = */ {},
-                       Ci.nsICookie2.SAMESITE_UNSET);
+                       Ci.nsICookie2.SAMESITE_NONE);
   return cookie;
 }
 
 function createTestCookie(scheme, secure = false) {
   let r = Math.round(Math.random() * 100000);
 
   let cookie = {
     host: `${scheme}://example.com`,
--- a/devtools/server/actors/storage.js
+++ b/devtools/server/actors/storage.js
@@ -566,17 +566,17 @@ StorageActors.createActor({
 
   getSameSiteStringFromCookie(cookie) {
     switch (cookie.sameSite) {
       case cookie.SAMESITE_LAX:
         return COOKIE_SAMESITE.LAX;
       case cookie.SAMESITE_STRICT:
         return COOKIE_SAMESITE.STRICT;
     }
-    // cookie.SAMESITE_UNSET
+    // cookie.SAMESITE_NONE
     return COOKIE_SAMESITE.UNSET;
   },
 
   populateStoresForHost(host) {
     this.hostVsStores.set(host, new Map());
     const doc = this.storageActor.document;
 
     const cookies = this.getCookiesFromHost(host, doc.nodePrincipal
--- a/mobile/android/components/extensions/test/mochitest/test_ext_browsingData_cookies_cache.html
+++ b/mobile/android/components/extensions/test/mochitest/test_ext_browsingData_cookies_cache.html
@@ -18,17 +18,17 @@ const COOKIE = {
   host: "example.com",
   name: "test_cookie",
   path: "/",
 };
 let since, oldCookie;
 
 function addCookie(cookie) {
   let expiry =  Date.now() / 1000 + 10000;
-  Services.cookies.add(cookie.host, cookie.path, cookie.name, "test", false, false, false, expiry, {}, Ci.nsICookie2.SAMESITE_UNSET);
+  Services.cookies.add(cookie.host, cookie.path, cookie.name, "test", false, false, false, expiry, {}, Ci.nsICookie2.SAMESITE_NONE);
   ok(Services.cookies.cookieExists(cookie.host, cookie.path, cookie.name, {}), `Cookie ${cookie.name} was created.`);
 }
 
 async function setUpCookies() {
   // Add a cookie which will end up with an older creationTime.
   oldCookie = Object.assign({}, COOKIE, {name: Date.now()});
   addCookie(oldCookie);
   await new Promise(resolve => setTimeout(resolve, 20));
--- a/netwerk/cookie/nsCookieService.cpp
+++ b/netwerk/cookie/nsCookieService.cpp
@@ -2866,17 +2866,17 @@ nsCookieService::ImportCookies(nsIFile* 
     RefPtr<nsCookie> newCookie = nsCookie::Create(
         Substring(buffer, nameIndex, cookieIndex - nameIndex - 1),
         Substring(buffer, cookieIndex, buffer.Length() - cookieIndex), host,
         Substring(buffer, pathIndex, secureIndex - pathIndex - 1), expires,
         lastAccessedCounter,
         nsCookie::GenerateUniqueCreationTime(currentTimeInUsec), false,
         Substring(buffer, secureIndex, expiresIndex - secureIndex - 1)
             .EqualsLiteral(kTrue),
-        isHttpOnly, key.mOriginAttributes, nsICookie2::SAMESITE_UNSET);
+        isHttpOnly, key.mOriginAttributes, nsICookie2::SAMESITE_NONE);
     if (!newCookie) {
       return NS_ERROR_OUT_OF_MEMORY;
     }
 
     // trick: preserve the most-recently-used cookie ordering,
     // by successively decrementing the lastAccessed time
     lastAccessedCounter--;
 
@@ -3313,17 +3313,17 @@ bool nsCookieService::CanSetCookie(nsIUR
   if (aCookieAttributes.isSecure && !isHTTPS) {
     COOKIE_LOGFAILURE(SET_COOKIE, aHostURI, aCookieHeader,
                       "non-https cookie can't set secure flag");
     return newCookie;
   }
 
   // If the new cookie is same-site but in a cross site context,
   // browser must ignore the cookie.
-  if ((aCookieAttributes.sameSite != nsICookie2::SAMESITE_UNSET) &&
+  if ((aCookieAttributes.sameSite != nsICookie2::SAMESITE_NONE) &&
       aThirdPartyUtil) {
     // Do not treat loads triggered by web extensions as foreign
     bool addonAllowsLoad = false;
     if (aChannel) {
       nsCOMPtr<nsIURI> channelURI;
       NS_GetFinalChannelURI(aChannel, getter_AddRefs(channelURI));
       nsCOMPtr<nsILoadInfo> loadInfo = aChannel->LoadInfo();
       addonAllowsLoad = BasePrincipal::Cast(loadInfo->TriggeringPrincipal())
@@ -3756,17 +3756,17 @@ bool nsCookieService::ParseAttributes(ns
 
   nsACString::const_char_iterator tempBegin, tempEnd;
   nsACString::const_char_iterator cookieStart, cookieEnd;
   aCookieHeader.BeginReading(cookieStart);
   aCookieHeader.EndReading(cookieEnd);
 
   aCookieAttributes.isSecure = false;
   aCookieAttributes.isHttpOnly = false;
-  aCookieAttributes.sameSite = nsICookie2::SAMESITE_UNSET;
+  aCookieAttributes.sameSite = nsICookie2::SAMESITE_NONE;
 
   nsDependentCSubstring tokenString(cookieStart, cookieStart);
   nsDependentCSubstring tokenValue(cookieStart, cookieStart);
   bool newCookie, equalsFound;
 
   // extract cookie <NAME> & <VALUE> (first attribute), and copy the strings.
   // if we find multiple cookies, return for processing
   // note: if there's no '=', we assume token is <VALUE>. this is required by
--- a/netwerk/cookie/nsICookie2.idl
+++ b/netwerk/cookie/nsICookie2.idl
@@ -9,17 +9,17 @@
  * Main cookie object interface for use by consumers:
  * extends nsICookie, a frozen interface for external
  * access of cookie objects
  */
 
 [builtinclass, scriptable, uuid(be205dae-4f4c-11e6-80ba-ea5cd310c1a8)]
 interface nsICookie2 : nsICookie
 {
-    const uint32_t SAMESITE_UNSET  = 0;
+    const uint32_t SAMESITE_NONE   = 0;
     const uint32_t SAMESITE_LAX    = 1;
     const uint32_t SAMESITE_STRICT = 2;
 
     /**
      * the host (possibly fully qualified) of the cookie,
      * without a leading dot to represent if it is a
      * domain cookie.
      */
@@ -63,14 +63,14 @@ interface nsICookie2 : nsICookie
     readonly attribute int64_t lastAccessed;
 
     /**
      * the sameSite attribute; this controls the cookie behavior for cross-site
      * requests as per
      * https://tools.ietf.org/html/draft-west-first-party-cookies-07
      *
      * This should be one of:
-     * - SAMESITE_UNSET - the SameSite attribute is not present
+     * - SAMESITE_NONE - the SameSite attribute is not present
      * - SAMESITE_LAX - the SameSite attribute is present, but not strict
      * - SAMESITE_STRICT - the SameSite attribute is present and strict
      */
     readonly attribute int32_t sameSite;
 };
--- a/netwerk/test/TestCookie.cpp
+++ b/netwerk/test/TestCookie.cpp
@@ -852,39 +852,39 @@ TEST(TestCookie, TestCookieMain)
                             NS_LITERAL_CSTRING("/foo"),            // path
                             NS_LITERAL_CSTRING("test1"),           // name
                             NS_LITERAL_CSTRING("yes"),             // value
                             false,                                 // is secure
                             false,      // is httponly
                             true,       // is session
                             INT64_MAX,  // expiry time
                             &attrs,     // originAttributes
-                            nsICookie2::SAMESITE_UNSET)));
+                            nsICookie2::SAMESITE_NONE)));
   EXPECT_TRUE(NS_SUCCEEDED(
       cookieMgr2->AddNative(NS_LITERAL_CSTRING("cookiemgr.test"),  // domain
                             NS_LITERAL_CSTRING("/foo"),            // path
                             NS_LITERAL_CSTRING("test2"),           // name
                             NS_LITERAL_CSTRING("yes"),             // value
                             false,                                 // is secure
                             true,                            // is httponly
                             true,                            // is session
                             PR_Now() / PR_USEC_PER_SEC + 2,  // expiry time
                             &attrs,                          // originAttributes
-                            nsICookie2::SAMESITE_UNSET)));
+                            nsICookie2::SAMESITE_NONE)));
   EXPECT_TRUE(NS_SUCCEEDED(
       cookieMgr2->AddNative(NS_LITERAL_CSTRING("new.domain"),  // domain
                             NS_LITERAL_CSTRING("/rabbit"),     // path
                             NS_LITERAL_CSTRING("test3"),       // name
                             NS_LITERAL_CSTRING("yes"),         // value
                             false,                             // is secure
                             false,                             // is httponly
                             true,                              // is session
                             INT64_MAX,                         // expiry time
                             &attrs,  // originAttributes
-                            nsICookie2::SAMESITE_UNSET)));
+                            nsICookie2::SAMESITE_NONE)));
   // confirm using enumerator
   nsCOMPtr<nsISimpleEnumerator> enumerator;
   EXPECT_TRUE(
       NS_SUCCEEDED(cookieMgr->GetEnumerator(getter_AddRefs(enumerator))));
   int32_t i = 0;
   bool more;
   nsCOMPtr<nsICookie2> expiredCookie, newDomainCookie;
   while (NS_SUCCEEDED(enumerator->HasMoreElements(&more)) && more) {
@@ -936,17 +936,17 @@ TEST(TestCookie, TestCookieMain)
                             NS_LITERAL_CSTRING("/rabbit"),     // path
                             NS_LITERAL_CSTRING("test3"),       // name
                             NS_LITERAL_CSTRING("yes"),         // value
                             false,                             // is secure
                             false,                             // is httponly
                             true,                              // is session
                             INT64_MIN,                         // expiry time
                             &attrs,  // originAttributes
-                            nsICookie2::SAMESITE_UNSET)));
+                            nsICookie2::SAMESITE_NONE)));
   EXPECT_TRUE(NS_SUCCEEDED(cookieMgr2->CookieExistsNative(
       NS_LITERAL_CSTRING("new.domain"), NS_LITERAL_CSTRING("/rabbit"),
       NS_LITERAL_CSTRING("test3"), &attrs, &found)));
   EXPECT_FALSE(found);
   // sleep four seconds, to make sure the second cookie has expired
   PR_Sleep(4 * PR_TicksPerSecond());
   // check that both CountCookiesFromHost() and CookieExistsNative() count the
   // expired cookie
@@ -1074,23 +1074,23 @@ TEST(TestCookie, TestCookieMain)
     // keep tabs on the second and third cookies, so we can check them later
     nsCOMPtr<nsICookie2> cookie2(do_QueryInterface(cookie));
     if (!cookie2) break;
     nsAutoCString name;
     cookie2->GetName(name);
     int32_t sameSiteAttr;
     cookie2->GetSameSite(&sameSiteAttr);
     if (name.EqualsLiteral("unset")) {
-      EXPECT_TRUE(sameSiteAttr == nsICookie2::SAMESITE_UNSET);
+      EXPECT_TRUE(sameSiteAttr == nsICookie2::SAMESITE_NONE);
     } else if (name.EqualsLiteral("unspecified")) {
-      EXPECT_TRUE(sameSiteAttr == nsICookie2::SAMESITE_UNSET);
+      EXPECT_TRUE(sameSiteAttr == nsICookie2::SAMESITE_NONE);
     } else if (name.EqualsLiteral("empty")) {
-      EXPECT_TRUE(sameSiteAttr == nsICookie2::SAMESITE_UNSET);
+      EXPECT_TRUE(sameSiteAttr == nsICookie2::SAMESITE_NONE);
     } else if (name.EqualsLiteral("bogus")) {
-      EXPECT_TRUE(sameSiteAttr == nsICookie2::SAMESITE_UNSET);
+      EXPECT_TRUE(sameSiteAttr == nsICookie2::SAMESITE_NONE);
     } else if (name.EqualsLiteral("strict")) {
       EXPECT_TRUE(sameSiteAttr == nsICookie2::SAMESITE_STRICT);
     } else if (name.EqualsLiteral("lax")) {
       EXPECT_TRUE(sameSiteAttr == nsICookie2::SAMESITE_LAX);
     }
   }
 
   EXPECT_TRUE(i == 6);
--- a/netwerk/test/mochitests/file_testloadflags_chromescript.js
+++ b/netwerk/test/mochitests/file_testloadflags_chromescript.js
@@ -78,17 +78,17 @@ addMessageListener("init", ({ domain }) 
 
   info("we are going to remove these cookies");
 
   let count = getCookieCount(cs);
   info(count + " cookies");
 
   cs.removeAll();
   cs.add(domain, "", "oh", "hai", false, false, true, Math.pow(2, 62), {},
-         Ci.nsICookie2.SAMESITE_UNSET);
+         Ci.nsICookie2.SAMESITE_NONE);
   is(cs.countCookiesFromHost(domain), 1, "number of cookies for domain " + domain);
 
   gObs = new obs();
   sendAsyncMessage("init:return");
 });
 
 addMessageListener("getCookieCount", () => {
   let cs = Cc["@mozilla.org/cookiemanager;1"]
--- a/netwerk/test/unit/test_bug411952.js
+++ b/netwerk/test/unit/test_bug411952.js
@@ -1,16 +1,16 @@
 function run_test() {
   try {
     var cm = Cc["@mozilla.org/cookiemanager;1"].
                getService(Ci.nsICookieManager);
     Assert.notEqual(cm, null, "Retrieving the cookie manager failed");
 
     const time = (new Date("Jan 1, 2030")).getTime() / 1000;
-    cm.add("example.com", "/", "C", "V", false, true, false, time, {}, Ci.nsICookie2.SAMESITE_UNSET);
+    cm.add("example.com", "/", "C", "V", false, true, false, time, {}, Ci.nsICookie2.SAMESITE_NONE);
     const now = Math.floor((new Date()).getTime() / 1000);
 
     var found = false;
     for (let cookie of cm.enumerator) {
       if (cookie.host == "example.com" &&
           cookie.path == "/" &&
           cookie.name == "C") {
         Assert.ok("creationTime" in cookie,
--- a/netwerk/test/unit/test_bug526789.js
+++ b/netwerk/test/unit/test_bug526789.js
@@ -9,17 +9,17 @@ function run_test() {
   cm.removeAll();
 
   // Allow all cookies.
   Services.prefs.setIntPref("network.cookie.cookieBehavior", 0);
 
   // test that variants of 'baz.com' get normalized appropriately, but that
   // malformed hosts are rejected
   cm.add("baz.com", "/", "foo", "bar", false, false, true, expiry, {},
-         Ci.nsICookie2.SAMESITE_UNSET);
+         Ci.nsICookie2.SAMESITE_NONE);
   Assert.equal(cm.countCookiesFromHost("baz.com"), 1);
   Assert.equal(cm.countCookiesFromHost("BAZ.com"), 1);
   Assert.equal(cm.countCookiesFromHost(".baz.com"), 1);
   Assert.equal(cm.countCookiesFromHost("baz.com."), 0);
   Assert.equal(cm.countCookiesFromHost(".baz.com."), 0);
   do_check_throws(function() {
     cm.countCookiesFromHost("baz.com..");
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
@@ -31,53 +31,53 @@ function run_test() {
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
   cm.remove("BAZ.com.", "foo", "/", false, {});
   Assert.equal(cm.countCookiesFromHost("baz.com"), 1);
   cm.remove("baz.com", "foo", "/", false, {});
   Assert.equal(cm.countCookiesFromHost("baz.com"), 0);
 
   // Test that 'baz.com' and 'baz.com.' are treated differently
   cm.add("baz.com.", "/", "foo", "bar", false, false, true, expiry, {},
-         Ci.nsICookie2.SAMESITE_UNSET);
+         Ci.nsICookie2.SAMESITE_NONE);
   Assert.equal(cm.countCookiesFromHost("baz.com"), 0);
   Assert.equal(cm.countCookiesFromHost("BAZ.com"), 0);
   Assert.equal(cm.countCookiesFromHost(".baz.com"), 0);
   Assert.equal(cm.countCookiesFromHost("baz.com."), 1);
   Assert.equal(cm.countCookiesFromHost(".baz.com."), 1);
   cm.remove("baz.com", "foo", "/", false, {});
   Assert.equal(cm.countCookiesFromHost("baz.com."), 1);
   cm.remove("baz.com.", "foo", "/", false, {});
   Assert.equal(cm.countCookiesFromHost("baz.com."), 0);
 
   // test that domain cookies are illegal for IP addresses, aliases such as
   // 'localhost', and eTLD's such as 'co.uk'
   cm.add("192.168.0.1", "/", "foo", "bar", false, false, true, expiry, {},
-         Ci.nsICookie2.SAMESITE_UNSET);
+         Ci.nsICookie2.SAMESITE_NONE);
   Assert.equal(cm.countCookiesFromHost("192.168.0.1"), 1);
   Assert.equal(cm.countCookiesFromHost("192.168.0.1."), 0);
   do_check_throws(function() {
     cm.countCookiesFromHost(".192.168.0.1");
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
   do_check_throws(function() {
     cm.countCookiesFromHost(".192.168.0.1.");
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
 
   cm.add("localhost", "/", "foo", "bar", false, false, true, expiry, {},
-         Ci.nsICookie2.SAMESITE_UNSET);
+         Ci.nsICookie2.SAMESITE_NONE);
   Assert.equal(cm.countCookiesFromHost("localhost"), 1);
   Assert.equal(cm.countCookiesFromHost("localhost."), 0);
   do_check_throws(function() {
     cm.countCookiesFromHost(".localhost");
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
   do_check_throws(function() {
     cm.countCookiesFromHost(".localhost.");
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
 
   cm.add("co.uk", "/", "foo", "bar", false, false, true, expiry, {},
-         Ci.nsICookie2.SAMESITE_UNSET);
+         Ci.nsICookie2.SAMESITE_NONE);
   Assert.equal(cm.countCookiesFromHost("co.uk"), 1);
   Assert.equal(cm.countCookiesFromHost("co.uk."), 0);
   do_check_throws(function() {
     cm.countCookiesFromHost(".co.uk");
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
   do_check_throws(function() {
     cm.countCookiesFromHost(".co.uk.");
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
@@ -155,21 +155,21 @@ function run_test() {
     cm.getCookiesFromHost(".", {});
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
 
   cm.removeAll();
 
   // test that an empty host to add() or remove() works,
   // but a host of '.' doesn't
   cm.add("", "/", "foo2", "bar", false, false, true, expiry, {},
-         Ci.nsICookie2.SAMESITE_UNSET);
+         Ci.nsICookie2.SAMESITE_NONE);
   Assert.equal(getCookieCount(), 1);
   do_check_throws(function() {
     cm.add(".", "/", "foo3", "bar", false, false, true, expiry, {},
-           Ci.nsICookie2.SAMESITE_UNSET);
+           Ci.nsICookie2.SAMESITE_NONE);
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
   Assert.equal(getCookieCount(), 1);
 
   cm.remove("", "foo2", "/", false, {});
   Assert.equal(getCookieCount(), 0);
   do_check_throws(function() {
     cm.remove(".", "foo3", "/", false, {});
   }, Cr.NS_ERROR_ILLEGAL_VALUE);
--- a/netwerk/test/unit/test_bug650522.js
+++ b/netwerk/test/unit/test_bug650522.js
@@ -3,12 +3,12 @@
 
 function run_test() {
   var cs = Cc["@mozilla.org/cookieService;1"].getService(Ci.nsICookieService);
   var cm = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager);
   var expiry = (Date.now() + 1000) * 1000;
 
   // Test our handling of host names with a single character at the beginning
   // followed by a dot.
-  cm.add("e.mail.com", "/", "foo", "bar", false, false, true, expiry, {}, Ci.nsICookie2.SAMESITE_UNSET);
+  cm.add("e.mail.com", "/", "foo", "bar", false, false, true, expiry, {}, Ci.nsICookie2.SAMESITE_NONE);
   Assert.equal(cm.countCookiesFromHost("e.mail.com"), 1);
   Assert.equal(cs.getCookieString(NetUtil.newURI("http://e.mail.com"), null), "foo=bar");
 }
--- a/netwerk/test/unit/test_bug667087.js
+++ b/netwerk/test/unit/test_bug667087.js
@@ -3,12 +3,12 @@
 
 function run_test() {
   var cs = Cc["@mozilla.org/cookieService;1"].getService(Ci.nsICookieService);
   var cm = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager);
   var expiry = (Date.now() + 1000) * 1000;
 
   // Test our handling of host names with a single character consisting only
   // of a single character
-  cm.add("a", "/", "foo", "bar", false, false, true, expiry, {}, Ci.nsICookie2.SAMESITE_UNSET);
+  cm.add("a", "/", "foo", "bar", false, false, true, expiry, {}, Ci.nsICookie2.SAMESITE_NONE);
   Assert.equal(cm.countCookiesFromHost("a"), 1);
   Assert.equal(cs.getCookieString(NetUtil.newURI("http://a"), null), "foo=bar");
 }
--- a/netwerk/test/unit/test_cookies_async_failure.js
+++ b/netwerk/test/unit/test_cookies_async_failure.js
@@ -154,17 +154,17 @@ function* run_test_1(generator)
 
   // Insert a row.
   db.insertCookie(cookie);
   db.close();
 
   // Attempt to insert a cookie with the same (name, host, path) triplet.
   Services.cookiemgr.add(cookie.host, cookie.path, cookie.name, "hallo",
     cookie.isSecure, cookie.isHttpOnly, cookie.isSession, cookie.expiry, {},
-    Ci.nsICookie2.SAMESITE_UNSET);
+    Ci.nsICookie2.SAMESITE_NONE);
 
   // Check that the cookie service accepted the new cookie.
   Assert.equal(Services.cookiemgr.countCookiesFromHost(cookie.host), 1);
 
   let isRebuildingDone = false;
   let rebuildingObserve = function (subject, topic, data) {
     isRebuildingDone = true;
     Services.obs.removeObserver(rebuildingObserve, "cookie-db-rebuilding");
--- a/netwerk/test/unit/test_cookies_profile_close.js
+++ b/netwerk/test/unit/test_cookies_profile_close.js
@@ -50,17 +50,17 @@ function* do_run_test() {
   }, Cr.NS_ERROR_NOT_AVAILABLE);
 
   do_check_throws(function() {
     Services.cookiemgr.enumerator;
   }, Cr.NS_ERROR_NOT_AVAILABLE);
 
   do_check_throws(function() {
     Services.cookiemgr.add("foo.com", "", "oh4", "hai", false, false, false, 0, {},
-                           Ci.nsICookie2.SAMESITE_UNSET);
+                           Ci.nsICookie2.SAMESITE_NONE);
   }, Cr.NS_ERROR_NOT_AVAILABLE);
 
   do_check_throws(function() {
     Services.cookiemgr.remove("foo.com", "", "oh4", false, {});
   }, Cr.NS_ERROR_NOT_AVAILABLE);
 
   do_check_throws(function() {
     let file = profile.clone();
--- a/netwerk/test/unit/test_domain_eviction.js
+++ b/netwerk/test/unit/test_domain_eviction.js
@@ -63,39 +63,39 @@ function* do_run_test()
     if (cookie.host == "horse.radish")
       do_throw("cookies not evicted by lastAccessed order");
   }
 
   // Test that expired cookies for a domain are evicted before live ones.
   let shortExpiry = Math.floor(Date.now() / 1000 + 2);
   setCookies("captchart.com", 49, futureExpiry);
   Services.cookiemgr.add("captchart.com", "", "test100", "eviction",
-    false, false, false, shortExpiry, {}, Ci.nsICookie2.SAMESITE_UNSET);
+    false, false, false, shortExpiry, {}, Ci.nsICookie2.SAMESITE_NONE);
   do_timeout(2100, continue_test);
   yield;
 
   Assert.equal(countCookies("captchart.com", "captchart.com"), 50);
   Services.cookiemgr.add("captchart.com", "", "test200", "eviction",
-    false, false, false, futureExpiry, {}, Ci.nsICookie2.SAMESITE_UNSET);
+    false, false, false, futureExpiry, {}, Ci.nsICookie2.SAMESITE_NONE);
   Assert.equal(countCookies("captchart.com", "captchart.com"), 50);
 
   for (let cookie of Services.cookiemgr.getCookiesFromHost("captchart.com", {})) {
     Assert.ok(cookie.expiry == futureExpiry);
   }
 
   do_finish_generator_test(test_generator);
 }
 
 // set 'aNumber' cookies with host 'aHost', with distinct names.
 function
 setCookies(aHost, aNumber, aExpiry)
 {
   for (let i = 0; i < aNumber; ++i)
     Services.cookiemgr.add(aHost, "", "test" + i, "eviction",
-      false, false, false, aExpiry, {}, Ci.nsICookie2.SAMESITE_UNSET);
+      false, false, false, aExpiry, {}, Ci.nsICookie2.SAMESITE_NONE);
 }
 
 // count how many cookies are within domain 'aBaseDomain', using three
 // independent interface methods on nsICookieManager:
 // 1) 'enumerator', an enumerator of all cookies;
 // 2) 'countCookiesFromHost', which returns the number of cookies within the
 //    base domain of 'aHost',
 // 3) 'getCookiesFromHost', which returns an enumerator of 2).
--- a/netwerk/test/unit/test_eviction.js
+++ b/netwerk/test/unit/test_eviction.js
@@ -194,17 +194,17 @@ function* do_run_test()
 function set_cookies(begin, end, expiry)
 {
   Assert.ok(begin != end);
 
   let beginTime;
   for (let i = begin; i < end; ++i) {
     let host = "eviction." + i + ".tests";
     Services.cookiemgr.add(host, "", "test", "eviction", false, false, false,
-      expiry, {}, Ci.nsICookie2.SAMESITE_UNSET);
+      expiry, {}, Ci.nsICookie2.SAMESITE_NONE);
 
     if (i == begin)
       beginTime = get_creationTime(i);
   }
 
   let endTime = get_creationTime(end - 1);
   Assert.ok(begin == end - 1 || endTime > beginTime);
   if (endTime - beginTime > gPurgeAge * 1000000) {
--- a/netwerk/test/unit_ipc/test_cookie_header_stripped.js
+++ b/netwerk/test/unit_ipc/test_cookie_header_stripped.js
@@ -56,15 +56,15 @@ function run_test() {
   // manually.
   do_await_remote_message("second-check-cookie-count").then(() => {
     do_send_remote_message("second-check-cookie-count-done", Services.cookies.countCookiesFromHost(TEST_DOMAIN));
   });
 
   // Sets a cookie for the test domain
   do_await_remote_message("set-cookie").then(() => {
     const expiry = Date.now() + 24 * 60 * 60;
-    Services.cookies.add(TEST_DOMAIN, "/", "cookieName", "cookieValue", false, false, false, expiry, {}, Ci.nsICookie2.SAMESITE_UNSET);
+    Services.cookies.add(TEST_DOMAIN, "/", "cookieName", "cookieValue", false, false, false, expiry, {}, Ci.nsICookie2.SAMESITE_NONE);
     do_send_remote_message("set-cookie-done");
   });
 
   // Run the actual test logic
   run_test_in_child("child_cookie_header.js");
 }
--- a/security/manager/ssl/tests/unit/test_toolkit_securityreporter.js
+++ b/security/manager/ssl/tests/unit/test_toolkit_securityreporter.js
@@ -87,17 +87,17 @@ function run_test() {
   Services.prefs.setCharPref("security.ssl.errorReporting.url",
                              `http://localhost:${port}/submit/sslreports`);
   // set strict-mode pinning enforcement so we can cause connection failures.
   Services.prefs.setIntPref("security.cert_pinning.enforcement_level", 2);
 
   // Add a cookie so that we can assert it's not sent along with the report.
   Services.cookies.add("localhost", "/", "foo", "bar",
                        false, false, false, Date.now() + 24000 * 60 * 60, {},
-                       Ci.nsICookie2.SAMESITE_UNSET);
+                       Ci.nsICookie2.SAMESITE_NONE);
 
   registerCleanupFunction(() => {
     Services.cookies.removeAll();
   });
 
   // start a TLS server
   add_tls_server_setup("BadCertServer", "bad_certs");
 
--- a/testing/marionette/cookie.js
+++ b/testing/marionette/cookie.js
@@ -164,17 +164,17 @@ cookie.add = function(newCookie, {restri
         newCookie.path,
         newCookie.name,
         newCookie.value,
         newCookie.secure,
         newCookie.httpOnly,
         newCookie.session,
         newCookie.expiry,
         {} /* origin attributes */,
-        Ci.nsICookie2.SAMESITE_UNSET);
+        Ci.nsICookie2.SAMESITE_NONE);
   } catch (e) {
     throw new UnableToSetCookieError(e);
   }
 };
 
 /**
  * Remove cookie from the cookie store.
  *
--- a/toolkit/components/cleardata/SiteDataTestUtils.jsm
+++ b/toolkit/components/cleardata/SiteDataTestUtils.jsm
@@ -78,17 +78,17 @@ var SiteDataTestUtils = {
    * @param {String} origin - the origin of the site to add test data for
    * @param {String} name [optional] - the cookie name
    * @param {String} value [optional] - the cookie value
    */
   addToCookies(origin, name = "foo", value = "bar") {
     let principal = Services.scriptSecurityManager.createCodebasePrincipalFromOrigin(origin);
     Services.cookies.add(principal.URI.host, principal.URI.pathQueryRef, name, value,
       false, false, false, Date.now() + 24000 * 60 * 60, {},
-      Ci.nsICookie2.SAMESITE_UNSET);
+      Ci.nsICookie2.SAMESITE_NONE);
   },
 
   /**
    * Adds a new serviceworker with the specified path. Note that this
    * method will open a new tab at the domain of the SW path to that effect.
    *
    * @param {String} path - the path to the service worker to add.
    *
--- a/toolkit/components/cleardata/tests/unit/test_cookies.js
+++ b/toolkit/components/cleardata/tests/unit/test_cookies.js
@@ -6,34 +6,34 @@
  */
 
 "use strict";
 
 add_task(async function test_all_cookies() {
   const expiry = Date.now() + 24 * 60 * 60;
   Services.cookies.add("example.net", "path", "name", "value", true /* secure */,
                        true /* http only */, false /* session */,
-                       expiry, {}, Ci.nsICookie2.SAMESITE_UNSET);
+                       expiry, {}, Ci.nsICookie2.SAMESITE_NONE);
   Assert.equal(Services.cookies.countCookiesFromHost("example.net"), 1);
 
   await new Promise(aResolve => {
     Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_COOKIES, value => {
       Assert.equal(value, 0);
       aResolve();
     });
   });
 
   Assert.equal(Services.cookies.countCookiesFromHost("example.net"), 0);
 });
 
 add_task(async function test_range_cookies() {
   const expiry = Date.now() + 24 * 60 * 60;
   Services.cookies.add("example.net", "path", "name", "value", true /* secure */,
                        true /* http only */, false /* session */,
-                       expiry, {}, Ci.nsICookie2.SAMESITE_UNSET);
+                       expiry, {}, Ci.nsICookie2.SAMESITE_NONE);
   Assert.equal(Services.cookies.countCookiesFromHost("example.net"), 1);
 
   // The cookie is out of time range here.
   let from = Date.now() + 60 * 60;
   await new Promise(aResolve => {
     Services.clearData.deleteDataInTimeRange(from * 1000, expiry * 2000, true /* user request */,
                                              Ci.nsIClearDataService.CLEAR_COOKIES, value => {
       Assert.equal(value, 0);
@@ -55,17 +55,17 @@ add_task(async function test_range_cooki
 
   Assert.equal(Services.cookies.countCookiesFromHost("example.net"), 0);
 });
 
 add_task(async function test_principal_cookies() {
   const expiry = Date.now() + 24 * 60 * 60;
   Services.cookies.add("example.net", "path", "name", "value", true /* secure */,
                        true /* http only */, false /* session */,
-                       expiry, {}, Ci.nsICookie2.SAMESITE_UNSET);
+                       expiry, {}, Ci.nsICookie2.SAMESITE_NONE);
   Assert.equal(Services.cookies.countCookiesFromHost("example.net"), 1);
 
   let uri = Services.io.newURI("http://example.com");
   let principal = Services.scriptSecurityManager.createCodebasePrincipal(uri, {});
   await new Promise(aResolve => {
     Services.clearData.deleteDataFromPrincipal(principal, true /* user request */,
                                                Ci.nsIClearDataService.CLEAR_COOKIES, value => {
       Assert.equal(value, 0);
--- a/toolkit/components/contextualidentity/tests/unit/test_corruptedFile.js
+++ b/toolkit/components/contextualidentity/tests/unit/test_corruptedFile.js
@@ -26,17 +26,17 @@ function createCookie(userContextId) {
                        COOKIE.path,
                        COOKIE.name,
                        COOKIE.value,
                        COOKIE.isSecure,
                        COOKIE.isHttpOnly,
                        COOKIE.isSession,
                        COOKIE.expiry,
                        {userContextId},
-                       Ci.nsICookie2.SAMESITE_UNSET);
+                       Ci.nsICookie2.SAMESITE_NONE);
 }
 
 function hasCookie(userContextId) {
   let found = false;
   for (let cookie of Services.cookies.getCookiesFromHost(BASE_URL, {userContextId})) {
     if (cookie.originAttributes.userContextId == userContextId) {
       found = true;
       break;
--- a/toolkit/components/extensions/parent/ext-cookies.js
+++ b/toolkit/components/extensions/parent/ext-cookies.js
@@ -5,17 +5,17 @@ ChromeUtils.defineModuleGetter(this, "Se
 
 /* globals DEFAULT_STORE, PRIVATE_STORE */
 
 var {
   ExtensionError,
 } = ExtensionUtils;
 
 const SAME_SITE_STATUSES = [
-  "no_restriction", // Index 0 = Ci.nsICookie2.SAMESITE_UNSET
+  "no_restriction", // Index 0 = Ci.nsICookie2.SAMESITE_NONE
   "lax",            // Index 1 = Ci.nsICookie2.SAMESITE_LAX
   "strict",         // Index 2 = Ci.nsICookie2.SAMESITE_STRICT
 ];
 
 const isIPv4 = (host) => {
   let match = /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/.exec(host);
 
   if (match) {
--- a/toolkit/components/extensions/test/mochitest/head_cookies.js
+++ b/toolkit/components/extensions/test/mochitest/head_cookies.js
@@ -93,25 +93,25 @@ async function testCookies(options) {
 
   let stepOne = loadChromeScript(() => {
     const {addMessageListener, sendAsyncMessage} = this;
     addMessageListener("options", options => {
       let domain = options.domain.replace(/^\.?/, ".");
       // This will be evicted after we add a fourth cookie.
       Services.cookies.add(domain, "/", "evicted", "bar", options.secure, false,
                            false, options.expiry, {},
-                           Ci.nsICookie2.SAMESITE_UNSET);
+                           Ci.nsICookie2.SAMESITE_NONE);
       // This will be modified by the background script.
       Services.cookies.add(domain, "/", "foo", "bar", options.secure, false,
                            false, options.expiry, {},
-                           Ci.nsICookie2.SAMESITE_UNSET);
+                           Ci.nsICookie2.SAMESITE_NONE);
       // This will be deleted by the background script.
       Services.cookies.add(domain, "/", "deleted", "bar", options.secure, false,
                            false, options.expiry, {},
-                           Ci.nsICookie2.SAMESITE_UNSET);
+                           Ci.nsICookie2.SAMESITE_NONE);
       sendAsyncMessage("done");
     });
   });
   stepOne.sendAsyncMessage("options", options);
   await stepOne.promiseOneMessage("done");
   stepOne.destroy();
 
   await extension.startup();
@@ -119,19 +119,19 @@ async function testCookies(options) {
   await extension.awaitMessage("change-cookies");
 
   let stepTwo = loadChromeScript(() => {
     const {addMessageListener, sendAsyncMessage} = this;
     addMessageListener("options", options => {
       let domain = options.domain.replace(/^\.?/, ".");
 
       Services.cookies.add(domain, "/", "x", "y", options.secure, false, false,
-                           options.expiry, {}, Ci.nsICookie2.SAMESITE_UNSET);
+                           options.expiry, {}, Ci.nsICookie2.SAMESITE_NONE);
       Services.cookies.add(domain, "/", "x", "z", options.secure, false, false,
-                           options.expiry, {}, Ci.nsICookie2.SAMESITE_UNSET);
+                           options.expiry, {}, Ci.nsICookie2.SAMESITE_NONE);
       Services.cookies.remove(domain, "x", "/", false, {});
       sendAsyncMessage("done");
     });
   });
   stepTwo.sendAsyncMessage("options", options);
   await stepTwo.promiseOneMessage("done");
   stepTwo.destroy();
 
--- a/toolkit/components/extensions/test/mochitest/test_ext_cookies_expiry.html
+++ b/toolkit/components/extensions/test/mochitest/test_ext_cookies_expiry.html
@@ -40,28 +40,28 @@ add_task(async function test_cookies_exp
     manifest: {
       "permissions": ["http://example.com/", "cookies"],
     },
     background,
   });
 
   let chromeScript = loadChromeScript(() => {
     const {sendAsyncMessage} = this;
-    Services.cookies.add(".example.com", "/", "first", "one", false, false, false, Date.now() / 1000 + 1, {}, Ci.nsICookie2.SAMESITE_UNSET);
+    Services.cookies.add(".example.com", "/", "first", "one", false, false, false, Date.now() / 1000 + 1, {}, Ci.nsICookie2.SAMESITE_NONE);
     sendAsyncMessage("done");
   });
   await chromeScript.promiseOneMessage("done");
   chromeScript.destroy();
 
   await extension.startup();
   await extension.awaitMessage("change-cookies");
 
   chromeScript = loadChromeScript(() => {
     const {sendAsyncMessage} = this;
-    Services.cookies.add(".example.com", "/", "first", "one-again", false, false, false, Date.now() / 1000 + 10, {}, Ci.nsICookie2.SAMESITE_UNSET);
+    Services.cookies.add(".example.com", "/", "first", "one-again", false, false, false, Date.now() / 1000 + 10, {}, Ci.nsICookie2.SAMESITE_NONE);
     sendAsyncMessage("done");
   });
   await chromeScript.promiseOneMessage("done");
   chromeScript.destroy();
 
   await extension.awaitFinish("cookie-expiry");
   await extension.unload();
 });
--- a/toolkit/components/extensions/test/mochitest/test_ext_cookies_incognito.html
+++ b/toolkit/components/extensions/test/mochitest/test_ext_cookies_incognito.html
@@ -86,20 +86,20 @@ add_task(async function test_cookies_inc
   await extension.startup();
   await extension.awaitMessage("set-cookies");
 
   let chromeScript = SpecialPowers.loadChromeScript(() => {
     const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
 
     Services.cookies.add("example.org", "/", "public", `foo${Math.random()}`,
                          false, false, false, Number.MAX_SAFE_INTEGER, {},
-                         Ci.nsICookie2.SAMESITE_UNSET);
+                         Ci.nsICookie2.SAMESITE_NONE);
     Services.cookies.add("example.org", "/", "private", `foo${Math.random()}`,
                          false, false, false, Number.MAX_SAFE_INTEGER, {privateBrowsingId: 1},
-                         Ci.nsICookie2.SAMESITE_UNSET);
+                         Ci.nsICookie2.SAMESITE_NONE);
   });
   extension.sendMessage("test-cookie-store");
   await extension.awaitFinish("cookies");
 
   await extension.unload();
   privateExtension.sendMessage("close");
   await privateExtension.awaitMessage("done");
   await privateExtension.unload();
--- a/toolkit/forgetaboutsite/test/browser/browser_cookieDomain.js
+++ b/toolkit/forgetaboutsite/test/browser/browser_cookieDomain.js
@@ -17,17 +17,17 @@ add_task(async _ => {
   // Let's clean up all the data.
   await new Promise(resolve => {
     Services.clearData.deleteData(Ci.nsIClearDataService.CLEAR_ALL, resolve);
   });
 
   // A cookie domain
   Services.cookies.add(".example.com", "/test", "foo", "bar",
     false, false, false, Date.now() + 24000 * 60 * 60, {},
-    Ci.nsICookie2.SAMESITE_UNSET);
+    Ci.nsICookie2.SAMESITE_NONE);
 
   // Cleaning up.
   await ForgetAboutSite.removeDataFromDomain("example.com");
 
   // All good.
   ok(!checkCookie("example.com", {}), "No cookies");
 
   // Clean up.
--- a/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js
+++ b/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js
@@ -35,17 +35,17 @@ const PREFERENCE_NAME = "test-pref";
 /**
  * Add a cookie to the cookie service.
  *
  * @param aDomain
  */
 function add_cookie(aDomain) {
   check_cookie_exists(aDomain, false);
   Services.cookies.add(aDomain, COOKIE_PATH, COOKIE_NAME, "", false, false, false,
-                       COOKIE_EXPIRY, {}, Ci.nsICookie2.SAMESITE_UNSET);
+                       COOKIE_EXPIRY, {}, Ci.nsICookie2.SAMESITE_NONE);
   check_cookie_exists(aDomain, true);
 }
 
 /**
  * Checks to ensure that a cookie exists or not for a domain.
  *
  * @param aDomain
  *        The domain to check for the cookie.
--- a/toolkit/mozapps/extensions/test/browser/browser_html_discover_view.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_html_discover_view.js
@@ -619,17 +619,17 @@ add_task(async function discopane_cache_
   is(apiHandler.requestCount, 3, "discovery API should be requested again");
 });
 
 add_task(async function discopane_no_cookies() {
   let requestPromise = new Promise(resolve => {
     amoServer.registerPathHandler("/discoapi", resolve);
   });
   Services.cookies.add(AMO_TEST_HOST, "/", "name", "value", false, false,
-    false, Date.now() / 1000 + 600, {}, Ci.nsICookie2.SAMESITE_UNSET);
+    false, Date.now() / 1000 + 600, {}, Ci.nsICookie2.SAMESITE_NONE);
   let win = await loadInitialView("discover");
   let request = await requestPromise;
   ok(!request.hasHeader("Cookie"), "discovery API should not receive cookies");
   await closeView(win);
 });
 
 // Telemetry for interaction that have not been covered by other tests yet.
 // - "Find more addons" button.
--- a/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_langpacks.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_AddonRepository_langpacks.js
@@ -97,15 +97,15 @@ add_task(async function test_cookies() {
     lastRequest = request;
     response.write(JSON.stringify({results: []}));
   });
 
   const COOKIE = "test";
   let expiration = Date.now() / 1000 + 60 * 60;
   Services.cookies.add("example.com", "/", COOKIE, "testing",
                        false, false, false, expiration, {},
-                       Ci.nsICookie2.SAMESITE_UNSET);
+                       Ci.nsICookie2.SAMESITE_NONE);
 
   await AddonRepository.getAvailableLangpacks();
 
   notEqual(lastRequest, null, "Received langpack request");
   equal(lastRequest.hasHeader("Cookie"), false, "Langpack request has no cookies");
 });
--- a/toolkit/mozapps/extensions/test/xpcshell/test_cookies.js
+++ b/toolkit/mozapps/extensions/test/xpcshell/test_cookies.js
@@ -49,17 +49,17 @@ add_task(async function test_cookies() {
   let xpiFetches = [];
   makeHandler("/update.xpi", xpiFetches, "");
 
   const COOKIE = "test";
   // cookies.add() takes a time in seconds
   let expiration = Date.now() / 1000 + 60 * 60;
   Services.cookies.add("example.com", "/", COOKIE, "testing",
                        false, false, false, expiration, {},
-                       Ci.nsICookie2.SAMESITE_UNSET);
+                       Ci.nsICookie2.SAMESITE_NONE);
 
   await promiseStartupManager();
 
   let addon = await promiseInstallWebExtension({
     manifest: {
       version: "1.0",
       applications: {
         gecko: {
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_cookies2.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_cookies2.js
@@ -4,17 +4,17 @@
 // This verifies bug 462739
 function test() {
   Harness.installEndedCallback = install_ended;
   Harness.installsCompletedCallback = finish_test;
   Harness.setup();
 
   Services.cookies.add("example.com", "/browser/" + RELATIVE_DIR, "xpinstall",
     "true", false, false, true, (Date.now() / 1000) + 60, {},
-    Ci.nsICookie2.SAMESITE_UNSET);
+    Ci.nsICookie2.SAMESITE_NONE);
 
   var pm = Services.perms;
   pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
   var triggers = encodeURIComponent(JSON.stringify({
     "Cookie check": TESTROOT + "cookieRedirect.sjs?" + TESTROOT + "amosigned.xpi",
   }));
   gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser);
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_cookies3.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_cookies3.js
@@ -4,17 +4,17 @@
 // This verifies bug 462739
 function test() {
   Harness.installEndedCallback = install_ended;
   Harness.installsCompletedCallback = finish_test;
   Harness.setup();
 
   Services.cookies.add("example.com", "/browser/" + RELATIVE_DIR, "xpinstall",
     "true", false, false, true, (Date.now() / 1000) + 60, {},
-    Ci.nsICookie2.SAMESITE_UNSET);
+    Ci.nsICookie2.SAMESITE_NONE);
 
   var pm = Services.perms;
   pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
   Services.prefs.setIntPref("network.cookie.cookieBehavior", 1);
 
   var triggers = encodeURIComponent(JSON.stringify({
     "Cookie check": TESTROOT + "cookieRedirect.sjs?" + TESTROOT + "amosigned.xpi",
--- a/toolkit/mozapps/extensions/test/xpinstall/browser_cookies4.js
+++ b/toolkit/mozapps/extensions/test/xpinstall/browser_cookies4.js
@@ -5,17 +5,17 @@
 // This verifies bug 462739
 function test() {
   Harness.downloadFailedCallback = download_failed;
   Harness.installsCompletedCallback = finish_test;
   Harness.setup();
 
   Services.cookies.add("example.org", "/browser/" + RELATIVE_DIR, "xpinstall",
     "true", false, false, true, (Date.now() / 1000) + 60, {},
-    Ci.nsICookie2.SAMESITE_UNSET);
+    Ci.nsICookie2.SAMESITE_NONE);
 
   var pm = Services.perms;
   pm.add(makeURI("http://example.com/"), "install", pm.ALLOW_ACTION);
 
   Services.prefs.setIntPref("network.cookie.cookieBehavior", 1);
 
   var triggers = encodeURIComponent(JSON.stringify({
     "Cookie check": TESTROOT2 + "cookieRedirect.sjs?" + TESTROOT + "amosigned.xpi",