Bug 1654556 - Log also "failed the samesite tests" cookie rejection reason, r=baku

Differential Revision: https://phabricator.services.mozilla.com/D84555
This commit is contained in:
Honza Bambas 2020-07-23 14:48:12 +00:00
parent 32271075ed
commit b984b89632
2 changed files with 9 additions and 0 deletions

View File

@ -1168,6 +1168,13 @@ bool CookieService::CanSetCookie(
aIsForeignAndNotAddon) {
COOKIE_LOGFAILURE(SET_COOKIE, aHostURI, savedCookieHeader,
"failed the samesite tests");
CookieLogging::LogMessageToConsole(
aCRC, aHostURI, nsIScriptError::warningFlag, CONSOLE_SAMESITE_CATEGORY,
"CookieRejectedForNonSameSiteness"_ns,
AutoTArray<nsString, 1>{
NS_ConvertUTF8toUTF16(aCookieData.name()),
});
return newCookie;
}

View File

@ -87,3 +87,5 @@ CookieRejectedThirdParty=Cookie “%1$S” has been rejected as third-party.
CookieRejectedNonsecureOverSecure=Cookie “%1$S” has been rejected because there is an existing “secure” cookie.
# LOCALIZATION NOTE (CookieRejectedExpired): %1$S is the cookie name.
CookieRejectedExpired=Cookie “%1$S” has been rejected because it is already expired.
# LOCALIZATION NOTE (CookieRejectedForNonSameSiteness): %1$S is the cookie name.
CookieRejectedForNonSameSiteness=Cookie “%1$S” has been rejected because it is in a cross-site context and its “SameSite” is “Lax” or “Strict”.