Package org.openqa.selenium
Class Cookie
java.lang.Object
org.openqa.selenium.Cookie
- All Implemented Interfaces:
 Serializable
- See Also:
 
- 
Nested Class Summary
Nested Classes - 
Constructor Summary
ConstructorsConstructorDescriptionCreate a cookie for the default path with the given name and value with no expiry set.Cookie(String name, String value, @Nullable String domain, @Nullable String path, @Nullable Date expiry) Creates an insecure non-httpOnly cookie.Cookie(String name, String value, @Nullable String domain, @Nullable String path, @Nullable Date expiry, boolean isSecure) Creates a non-httpOnly cookie.Cookie(String name, String value, @Nullable String domain, @Nullable String path, @Nullable Date expiry, boolean isSecure, boolean isHttpOnly) Creates a cookie.Cookie(String name, String value, @Nullable String domain, @Nullable String path, @Nullable Date expiry, boolean isSecure, boolean isHttpOnly, @Nullable String sameSite) Creates a cookie.Creates an insecure non-httpOnly cookie with no domain specified.Create a cookie. - 
Method Summary
Modifier and TypeMethodDescriptionbooleanTwo cookies are equal if the name and value match@Nullable String@Nullable DategetName()getPath()@Nullable StringgetValue()inthashCode()booleanbooleanisSecure()toJson()JSON object keys are defined in https://w3c.github.io/webdriver/#dfn-table-for-cookie-conversion.toString()voidvalidate() 
- 
Constructor Details
- 
Cookie
Creates an insecure non-httpOnly 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
public Cookie(String name, String value, @Nullable String domain, @Nullable String path, @Nullable Date expiry) Creates an insecure non-httpOnly 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
public Cookie(String name, String value, @Nullable String domain, @Nullable String path, @Nullable Date expiry, boolean isSecure) Creates a non-httpOnly 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, @Nullable String domain, @Nullable String path, @Nullable Date expiry, boolean isSecure, boolean isHttpOnly) 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.isHttpOnly- Whether this cookie is a httpOnly cooke.
 - 
Cookie
public Cookie(String name, String value, @Nullable String domain, @Nullable String path, @Nullable Date expiry, boolean isSecure, boolean isHttpOnly, @Nullable String sameSite) 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.isHttpOnly- Whether this cookie is a httpOnly cookie.sameSite- The samesite attribute of this cookie; e.g. None, Lax, Strict.
 - 
Cookie
Create a cookie for the default path with the given name and value with no expiry set.- Parameters:
 name- The cookie's namevalue- The cookie's value
 - 
Cookie
Create a cookie.- Parameters:
 name- The cookie's namevalue- The cookie's valuepath- The path the cookie is for
 
 - 
 - 
Method Details
- 
getName
 - 
getValue
 - 
getDomain
 - 
getPath
 - 
isSecure
public boolean isSecure() - 
isHttpOnly
public boolean isHttpOnly() - 
getExpiry
 - 
getSameSite
 - 
validate
public void validate() - 
toJson
JSON object keys are defined in https://w3c.github.io/webdriver/#dfn-table-for-cookie-conversion. - 
toString
 - 
equals
Two cookies are equal if the name and value match - 
hashCode
public int hashCode() 
 -