Interface Cookie

All Known Implementing Classes:
CookieDefault

public interface Cookie
An HTTP cookie.
  • Method Details

    • getName

      String getName()
      Gets the cookie name.
    • getValue

      String getValue()
      Gets the cookie value.
    • setValue

      void setValue(String value)
      Sets the cookie value.
    • getPath

      String getPath()
      Gets the cookie path.
    • setPath

      void setPath(String path)
      Sets the cookie path.
    • getDomain

      String getDomain()
      Gets the cookie domain.
    • setDomain

      void setDomain(String domain)
      Sets the cookie domain.
    • getExpires

      Date getExpires()
      Gets the date the cookie will expire at. If the date is in the past, the cookie will be deleted. If null the cookie will live for the current session (this is the default).
    • setExpires

      void setExpires(Date expires)
      Sets the date the cookie will expire. If the date is in the past, the cookie will be deleted. If null the cookie will live for the current session (this is the default).
    • setExpiresUsingMaxAge

      void setExpiresUsingMaxAge(int maxAge)
      Sets the number of seconds for a cookie to live. If maxAge < 0 : The "Expires date" will be in the past and the cookie will therefore be deleted. If maxAge == 0 : The "Expires date" will be null and the cookie will live for the session only. If maxAge > 0 : The "Expires date" will be the current date + 'maxAge' seconds.
    • isExpired

      boolean isExpired()
      Is this cookie expired?
    • isSecure

      boolean isSecure()
      Is the "secure" feature on?
    • setSecure

      void setSecure(boolean secure)
      Sets the "secure" feature on or off.
    • isHttpOnly

      boolean isHttpOnly()
      Is the cookie availableto the server and not to javascript?
    • setHttpOnly

      void setHttpOnly(boolean httpOnly)
      Sets if the cookie is available only for to the server anbd not to javascript.
    • getSameSite

      CookieSameSite getSameSite()
      The "sameSite" attribute. May be null to not add it at all.
    • setSameSite

      void setSameSite(CookieSameSite sameSite)
      The "sameSite" attribute to add.
    • isDiscard

      boolean isDiscard()
      Is this cookie to be discarded?
    • getVersion

      int getVersion()
      Gets the cookie version.