org.openqa.selenium
Class Cookie

java.lang.Object
  extended by org.openqa.selenium.Cookie

public class Cookie
extends Object


Nested Class Summary
static class Cookie.Builder
           
 
Constructor Summary
Cookie(String name, String value)
          Create a cookie for the default path with the given name and value with no expiry set.
Cookie(String name, String value, String path)
          Create a cookie.
Cookie(String name, String value, String path, Date expiry)
          Creates an insecure cookie with no domain specified.
Cookie(String name, String value, String domain, String path, Date expiry)
          Creates an insecure cookie.
Cookie(String name, String value, String domain, String path, Date expiry, boolean isSecure)
          Creates a cookie.
 
Method Summary
 boolean equals(Object o)
          Two cookies are equal if the name and value match
 String getDomain()
           
 Date getExpiry()
           
 String getName()
           
 String getPath()
           
 String getValue()
           
 int hashCode()
           
 boolean isSecure()
           
 String toString()
           
protected  void validate()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Cookie

public Cookie(String name,
              String value,
              String path,
              Date expiry)
Creates an insecure cookie with no domain specified.

Parameters:
name - The name of the cookie; may not be null or an empty string.
value - The cookie value; may not be null.
path - The path the cookie is visible to. If left blank or set to null, will be set to "/".
expiry - The cookie's expiration date; may be null.
See Also:
Cookie(String, String, String, String, Date)

Cookie

public Cookie(String name,
              String value,
              String domain,
              String path,
              Date expiry)
Creates an insecure cookie.

Parameters:
name - The name of the cookie; may not be null or an empty string.
value - The cookie value; may not be null.
domain - The domain the cookie is visible to.
path - The path the cookie is visible to. If left blank or set to null, will be set to "/".
expiry - The cookie's expiration date; may be null.
See Also:
Cookie(String, String, String, String, Date, boolean)

Cookie

public Cookie(String name,
              String value,
              String domain,
              String path,
              Date expiry,
              boolean isSecure)
Creates a cookie.

Parameters:
name - The name of the cookie; may not be null or an empty string.
value - The cookie value; may not be null.
domain - The domain the cookie is visible to.
path - The path the cookie is visible to. If left blank or set to null, will be set to "/".
expiry - The cookie's expiration date; may be null.
isSecure - Whether this cookie requires a secure connection.

Cookie

public Cookie(String name,
              String value)
Create a cookie for the default path with the given name and value with no expiry set.

Parameters:
name - The cookie's name
value - The cookie's value

Cookie

public Cookie(String name,
              String value,
              String path)
Create a cookie.

Parameters:
name - The cookie's name
value - The cookie's value
path - The path the cookie is for
Method Detail

getName

public String getName()

getValue

public String getValue()

getDomain

public String getDomain()

getPath

public String getPath()

isSecure

public boolean isSecure()

getExpiry

public Date getExpiry()

validate

protected void validate()

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Two cookies are equal if the name and value match

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2013. All Rights Reserved.