Class CookieDefault

java.lang.Object
org.spincast.core.cookies.CookieDefault
All Implemented Interfaces:
Cookie

public class CookieDefault extends Object implements Cookie
  • Constructor Details

  • Method Details

    • getValue

      public String getValue()
      Description copied from interface: Cookie
      Gets the cookie value.
      Specified by:
      getValue in interface Cookie
    • setValue

      public void setValue(String value)
      Description copied from interface: Cookie
      Sets the cookie value.
      Specified by:
      setValue in interface Cookie
    • getPath

      public String getPath()
      Description copied from interface: Cookie
      Gets the cookie path.
      Specified by:
      getPath in interface Cookie
    • setPath

      public void setPath(String path)
      Description copied from interface: Cookie
      Sets the cookie path.
      Specified by:
      setPath in interface Cookie
    • getDomain

      public String getDomain()
      Description copied from interface: Cookie
      Gets the cookie domain.
      Specified by:
      getDomain in interface Cookie
    • setDomain

      public void setDomain(String domain)
      Description copied from interface: Cookie
      Sets the cookie domain.
      Specified by:
      setDomain in interface Cookie
    • getExpires

      public Date getExpires()
      Description copied from interface: Cookie
      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).
      Specified by:
      getExpires in interface Cookie
    • setExpires

      public void setExpires(Date expires)
      Description copied from interface: Cookie
      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).
      Specified by:
      setExpires in interface Cookie
    • setExpiresUsingMaxAge

      public void setExpiresUsingMaxAge(int maxAge)
      Description copied from interface: Cookie
      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.
      Specified by:
      setExpiresUsingMaxAge in interface Cookie
    • isExpired

      public boolean isExpired()
      Description copied from interface: Cookie
      Is this cookie expired?
      Specified by:
      isExpired in interface Cookie
    • isSecure

      public boolean isSecure()
      Description copied from interface: Cookie
      Is the "secure" feature on?
      Specified by:
      isSecure in interface Cookie
    • setSecure

      public void setSecure(boolean secure)
      Description copied from interface: Cookie
      Sets the "secure" feature on or off.
      Specified by:
      setSecure in interface Cookie
    • isHttpOnly

      public boolean isHttpOnly()
      Description copied from interface: Cookie
      Is the cookie availableto the server and not to javascript?
      Specified by:
      isHttpOnly in interface Cookie
    • getSameSite

      public CookieSameSite getSameSite()
      Description copied from interface: Cookie
      The "sameSite" attribute. May be null to not add it at all.
      Specified by:
      getSameSite in interface Cookie
    • setSameSite

      public void setSameSite(CookieSameSite cookieSameSite)
      Description copied from interface: Cookie
      The "sameSite" attribute to add.
      Specified by:
      setSameSite in interface Cookie
    • setHttpOnly

      public void setHttpOnly(boolean httpOnly)
      Description copied from interface: Cookie
      Sets if the cookie is available only for to the server anbd not to javascript.
      Specified by:
      setHttpOnly in interface Cookie
    • getName

      public String getName()
      Description copied from interface: Cookie
      Gets the cookie name.
      Specified by:
      getName in interface Cookie
    • isDiscard

      public boolean isDiscard()
      Description copied from interface: Cookie
      Is this cookie to be discarded?
      Specified by:
      isDiscard in interface Cookie
    • getVersion

      public int getVersion()
      Description copied from interface: Cookie
      Gets the cookie version.
      Specified by:
      getVersion in interface Cookie
    • toString

      public String toString()
      Overrides:
      toString in class Object