public class Cookie extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
Cookie.Builder |
Constructor and Description |
---|
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 non-httpOnly cookie with no domain specified.
|
Cookie(String name,
String value,
String domain,
String path,
Date expiry)
Creates an insecure non-httpOnly cookie.
|
Cookie(String name,
String value,
String domain,
String path,
Date expiry,
boolean isSecure)
Creates a non-httpOnly cookie.
|
Cookie(String name,
String value,
String domain,
String path,
Date expiry,
boolean isSecure,
boolean isHttpOnly)
Creates a cookie.
|
Modifier and Type | Method and Description |
---|---|
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 |
isHttpOnly() |
boolean |
isSecure() |
String |
toString() |
void |
validate() |
public Cookie(String name, String value)
name
- The cookie's namevalue
- The cookie's valuepublic Cookie(String name, String value, String path)
name
- The cookie's namevalue
- The cookie's valuepath
- The path the cookie is forpublic Cookie(String name, String value, String path, Date expiry)
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.Cookie(String, String, String, String, Date)
public Cookie(String name, String value, String domain, String path, Date expiry)
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.Cookie(String, String, String, String, Date, boolean)
public Cookie(String name, String value, String domain, String path, Date expiry, boolean isSecure)
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.public Cookie(String name, String value, String domain, String path, Date expiry, boolean isSecure, boolean isHttpOnly)
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.isHttpOnly
- Whether this cookie is a httpOnly cooke.public boolean equals(Object o)
public String getDomain()
public Date getExpiry()
public String getName()
public String getPath()
public String getValue()
public boolean isHttpOnly()
public boolean isSecure()
public void validate()
Copyright © 2014-2017 Machine Publishers, LLC and the jBrowserDriver contributors.
Project homepage: https://github.com/machinepublishers/jbrowserdriver