Class SimpleCookie

  • All Implemented Interfaces:
    Cookie


    public class SimpleCookie
    extends Object
    implements Cookie
    Default Cookie implementation. 'HttpOnly' is supported out of the box, even on Servlet 2.4 and 2.5 container implementations, using raw header writing logic and not javax.servlet.http.Cookie objects (which only has 'HttpOnly' support in Servlet 2.6 specifications and above).
    Since:
    1.0
    • Constructor Detail

      • SimpleCookie

        public SimpleCookie()
      • SimpleCookie

        public SimpleCookie(String name)
      • SimpleCookie

        public SimpleCookie(Cookie cookie)
    • Method Detail

      • getName

        public String getName()
      • setName

        public void setName(String name)
      • getValue

        public String getValue()
      • setValue

        public void setValue(String value)
      • getComment

        public String getComment()
      • setComment

        public void setComment(String comment)
      • getDomain

        public String getDomain()
      • setDomain

        public void setDomain(String domain)
      • getPath

        public String getPath()
      • setPath

        public void setPath(String path)
      • getMaxAge

        public int getMaxAge()
      • setMaxAge

        public void setMaxAge(int maxAge)
      • getVersion

        public int getVersion()
      • setVersion

        public void setVersion(int version)
      • isSecure

        public boolean isSecure()
      • setSecure

        public void setSecure(boolean secure)
      • isHttpOnly

        public boolean isHttpOnly()
      • setHttpOnly

        public void setHttpOnly(boolean httpOnly)
      • saveTo

        public void saveTo(HttpServletRequest request,
                           HttpServletResponse response)
      • buildHeaderValue

        protected String buildHeaderValue(String name,
                                          String value,
                                          String comment,
                                          String domain,
                                          String path,
                                          int maxAge,
                                          int version,
                                          boolean secure,
                                          boolean httpOnly)
      • removeFrom

        public void removeFrom(HttpServletRequest request,
                               HttpServletResponse response)
      • readValue

        public String readValue(HttpServletRequest request,
                                HttpServletResponse ignored)