public class Cookie extends Object implements Serializable
Constructor and Description |
---|
Cookie(String sourceUrl,
String cookieStr)
Creates a Cookie for the specified sourceUrl from the specified cookieString, which has the following format (optional [] in any order):
|
Modifier and Type | Method and Description |
---|---|
Cookie |
copy()
Creates and returns a deep copy of this cookie.
|
String |
getDomain()
Retrieves the domain field of the cookie.
|
String |
getExpires()
Retrieves the (GMT String) expiry field of the cookie, eg Thu, 15-Apr-2010 20:00:00 GMT
|
boolean |
getHttpOnly()
Whether the HttpOnly flag is present.
|
String |
getName()
Retrieves the name field of the cookie.
|
String |
getPath()
Retrieves the path field of the cookie
|
boolean |
getSecure()
Whether the secure flag is present.
|
String |
getValue()
Retrieves the value field of the cookie.
|
boolean |
isExpired()
Whether the cookie has expired.
|
void |
setDomain(String domain)
Sets the domain of the cookie to the specified value.
|
void |
setExpires(String expires)
Sets the expires field of the cookie to the specified (GMT String) value, eg Thu, 15-Apr-2010 20:00:00 GMT
|
void |
setHttpOnly(boolean httpOnly)
Sets whether the cookie has the HttpOnly flag.
|
void |
setName(String name)
Sets the name field of the cookie to the specified value.
|
void |
setPath(String path)
Sets the path of the cookie to the specified value.
|
void |
setSecure(boolean secure)
Sets whether the cookie has the secure flag.
|
void |
setValue(String value)
Sets the value field of the cookie to the specified value.
|
String |
toString()
Returns a String representation of the Cookie (formatted as the Set-Cookie http header).
|
public Cookie(String sourceUrl, String cookieStr) throws JauntException
"cookieName=cookieValue (every cookie must have name and value, value can be "". This is the only req. field) [; expires=timeInGMTString] (eg expires=Thu, 15-Apr-2010 20:00:00 GMT) [; path=pathName] [; domain=domainName] [; secure] [; HttpOnly]"
JauntException
public Cookie copy()
public boolean isExpired()
public void setName(String name)
public void setValue(String value)
public void setExpires(String expires)
public void setPath(String path)
public void setDomain(String domain)
public void setSecure(boolean secure)
public void setHttpOnly(boolean httpOnly)
public String getName()
public String getValue()
public String getExpires()
public String getPath()
public String getDomain()
public boolean getSecure()
public boolean getHttpOnly()