android.webkit
public
final
class
android.webkit.CookieManager
CookieManager manages cookies according to RFC2109 spec.
Summary
Public Methods
Protected Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Public Methods
public
synchronized
boolean
acceptCookie()
Return whether cookie is enabled
Get cookie(s) for a given url so that it can be set to "cookie:" in http
request header.
Returns
- The cookies in the format of NAME=VALUE [; NAME=VALUE]
public
synchronized
boolean
hasCookies()
Return true if there are stored cookies.
public
synchronized
void
removeAllCookie()
Remove all cookies
public
synchronized
void
removeExpiredCookie()
Remove all expired cookies
public
synchronized
void
removeSessionCookie()
Remove all session cookies, which are cookies without expiration date
public
synchronized
void
setAcceptCookie(boolean accept)
Control whether cookie is enabled or disabled
Parameters
accept
| TRUE if accept cookie
|
public
void
setCookie(String url, String value)
Set cookie for a given url. The old cookie with same host/path/name will
be removed. The new cookie will be added if it is not expired or it does
not have expiration which implies it is session cookie.
Parameters
url
| The url which cookie is set for |
value
| The value for set-cookie: in http response header
|
Protected Methods
protected
Object
clone()
Returns a new instance of the same class as the receiver, whose slots
have been filled in with the values in the slots of the receiver.
Classes which wish to support cloning must specify that they implement
the Cloneable interface, since the implementation checks for this.
Returns
- Object a shallow copy of this object.