Class ServerCookie

java.lang.Object
org.broadleafcommerce.common.security.util.ServerCookie

public class ServerCookie extends Object
This is a modified version of the ServerCookie implementation taken from the Apache Tomcat source. This class allows Broadleaf to properly construct cookies for different browsers and include the httpOnly protection as well.
Author:
jfischer
  • Field Details

    • STRICT_SERVLET_COMPLIANCE

      public static final boolean STRICT_SERVLET_COMPLIANCE
      If set to true, we parse cookies according to the servlet spec,
      See Also:
    • ALWAYS_ADD_EXPIRES

      public static final boolean ALWAYS_ADD_EXPIRES
      If set to false, we don't use the IE6/7 Max-Age/Expires work around
      See Also:
  • Constructor Details

    • ServerCookie

      public ServerCookie()
  • Method Details

    • appendCookieValue

      public static void appendCookieValue(StringBuffer headerBuf, int version, String name, String value, String path, String domain, String comment, int maxAge, boolean isSecure, boolean isHttpOnly)
    • maybeQuote2

      public static int maybeQuote2(int version, StringBuffer buf, String value)
    • maybeQuote2

      public static int maybeQuote2(int version, StringBuffer buf, String value, boolean allowVersionSwitch)
    • maybeQuote2

      public static int maybeQuote2(int version, StringBuffer buf, String value, String literals, boolean allowVersionSwitch)
    • containsCTL

      public static boolean containsCTL(String value, int version)
    • alreadyQuoted

      public static boolean alreadyQuoted(String value)
    • isToken

      public static boolean isToken(String value)
    • isToken

      public static boolean isToken(String value, String literals)
    • isToken2

      public static boolean isToken2(String value)
    • isToken2

      public static boolean isToken2(String value, String literals)