Class Cookie

java.lang.Object
com.meterware.httpunit.cookies.Cookie

public class Cookie extends Object
An HTTP client-side cookie.
Author:
Russell Gold
  • Method Details

    • getExpiredTime

      public long getExpiredTime()
      Returns:
      the _expiredTime in milliseconds
    • getName

      public String getName()
      Returns the name of this cookie.
    • getValue

      public String getValue()
      Returns the value associated with this cookie.
    • setValue

      public void setValue(String value)
      Sets the value associated with this cookie.
    • getPath

      public String getPath()
      Returns the path to which this cookie is restricted.
    • getDomain

      public String getDomain()
      Returns the domain to which this cookie may be sent.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • isExpired

      public boolean isExpired()
      check whether the cookie is expired
      Returns:
      true if the _expiredTime is higher than the current System time
    • mayBeSentTo

      public boolean mayBeSentTo(URL url)
      may this cookie be sent to the given url?
      Parameters:
      url - - the unform resource locator to check
      Returns:
      true if the cookie is not expired and the path is accepted if a domain is set