Class CookieHandler


  • public class CookieHandler
    extends Object
    • Field Detail

      • LOGGER

        protected static final org.slf4j.Logger LOGGER
    • Constructor Detail

      • CookieHandler

        public CookieHandler​(String name)
        Default path that cookies will be visible to: "/", i.e. the entire server.
      • CookieHandler

        public CookieHandler​(String name,
                             String path)
    • Method Detail

      • get

        public javax.servlet.http.Cookie get​(javax.servlet.http.HttpServletRequest request)
      • getValue

        public String getValue​(javax.servlet.http.HttpServletRequest request)
      • addCookie

        public void addCookie​(javax.servlet.http.HttpServletResponse response,
                              String cookieValue)
      • addCookie

        public void addCookie​(javax.servlet.http.HttpServletResponse response,
                              String cookieValue,
                              Integer maxAge)
        Add a cookie with the given value and age to the response, using the cookie descriptor settings of this generator.
        Parameters:
        response - the HTTP response to add the cookie to
        cookieValue - the value of the cookie to add
        maxAge - max age value of the cookie to add
      • removeCookie

        public void removeCookie​(javax.servlet.http.HttpServletResponse response)
        Remove the cookie that this generator describes from the response. Will generate a cookie with empty value and max age 0.
        Parameters:
        response - the HTTP response to remove the cookie from
      • getName

        public String getName()
      • getPath

        public String getPath()
      • getDomain

        public String getDomain()
      • setDomain

        public void setDomain​(String domain)
      • getMaxAge

        public Integer getMaxAge()
      • setMaxAge

        public void setMaxAge​(Integer maxAge)
      • getSecure

        public Boolean getSecure()
      • setSecure

        public void setSecure​(Boolean secure)
      • getHttpOnly

        public Boolean getHttpOnly()
      • setHttpOnly

        public void setHttpOnly​(Boolean httpOnly)
      • getHostOnly

        public Boolean getHostOnly()
      • setHostOnly

        public void setHostOnly​(Boolean hostOnly)
      • getSameSite

        public String getSameSite()
      • setSameSite

        public void setSameSite​(String sameSite)