Class CookieUtil

java.lang.Object
com.atlassian.confluence.util.CookieUtil

public class CookieUtil extends Object
  • Field Details

    • INSTANCE

      public static final CookieUtil INSTANCE
  • Constructor Details

    • CookieUtil

      public CookieUtil()
  • Method Details

    • getSameSiteAttributeFromTomcatContext

      public static String getSameSiteAttributeFromTomcatContext(javax.servlet.http.HttpServletRequest request)
      Retrieves the `SameSite` attribute value from the Tomcat context by accessing the internal `Rfc6265CookieProcessor` object of the currently running application. This method uses reflection to access private fields in the servlet context to navigate to the `StandardContext` instance, which contains the `CookieProcessor`. The `CookieProcessor` is then queried for its `SameSite` attribute value. If an error occurs or the value cannot be retrieved, a default value is returned.