Class SameSiteNoneIncompatibleClientChecker


  • final class SameSiteNoneIncompatibleClientChecker
    extends Object
    A utility class that can check known user agents which are known to be incompatible with SameSite=None attribute.

    • Versions of Chrome from Chrome 51 to Chrome 66 (inclusive on both ends). These Chrome versions will reject a cookie with `SameSite=None`. This also affects older versions of Chromium-derived browsers, as well as Android WebView. This behavior was correct according to the version of the cookie specification at that time, but with the addition of the new "None" value to the specification, this behavior has been updated in Chrome 67 and newer. (Prior to Chrome 51, the SameSite attribute was ignored entirely and all cookies were treated as if they were `SameSite=None`.)
    • Versions of UC Browser on Android prior to version 12.13.2. Older versions will reject a cookie with `SameSite=None`. This behavior was correct according to the version of the cookie specification at that time, but with the addition of the new "None" value to the specification, this behavior has been updated in newer versions of UC Browser.
    • Versions of Safari and embedded browsers on MacOS 10.14 and all browsers on iOS 12. These versions will erroneously treat cookies marked with `SameSite=None` as if they were marked `SameSite=Strict`. This bug has been fixed on newer versions of iOS and MacOS.

    See Also:
    SameSite=None: Known Incompatible Clients.
    • Constructor Detail

      • SameSiteNoneIncompatibleClientChecker

        SameSiteNoneIncompatibleClientChecker()
    • Method Detail

      • shouldSendSameSiteNone

        public static boolean shouldSendSameSiteNone​(String useragent)
      • isSameSiteNoneIncompatible

        public static boolean isSameSiteNoneIncompatible​(String useragent)
      • hasWebKitSameSiteBug

        static boolean hasWebKitSameSiteBug​(String useragent)
      • dropsUnrecognizedSameSiteCookies

        static boolean dropsUnrecognizedSameSiteCookies​(String useragent)
      • isIosVersion

        static boolean isIosVersion​(int major,
                                    String useragent)
      • isMacosxVersion

        static boolean isMacosxVersion​(int major,
                                       int minor,
                                       String useragent)
      • isSafari

        static boolean isSafari​(String useragent)
      • isMacEmbeddedBrowser

        static boolean isMacEmbeddedBrowser​(String useragent)
      • isChromiumBased

        static boolean isChromiumBased​(String useragent)
      • isChromiumVersionAtLeast

        static boolean isChromiumVersionAtLeast​(int major,
                                                String useragent)
      • isUcBrowser

        static boolean isUcBrowser​(String useragent)
      • isUcBrowserVersionAtLeast

        static boolean isUcBrowserVersionAtLeast​(int major,
                                                 int minor,
                                                 int build,
                                                 String useragent)