Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public abstract class

CookieHandler

extends Object
java.lang.Object
   ↳ java.net.CookieHandler
Known Direct Subclasses

Class Overview

This class provides a way to manage cookies with a HTTP protocol handler.

Summary

Public Constructors
CookieHandler ()
Public Methods
abstract Map < String List < String >> >)">get ( URI uri, Map < String List < String >> requestHeaders)
Gets all cookies for a specific URI from the cookie cache.
static CookieHandler getDefault ()
Returns the system-wide cookie handler or null if not set.
abstract void >)">put ( URI uri, Map < String List < String >> responseHeaders)
Sets all cookies of a specific URI in the responseHeaders into the cookie cache.
static void setDefault ( CookieHandler cHandler)
Sets the system-wide cookie handler.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public CookieHandler ()

Added in API level 1

Public Methods

>)">

public abstract Map < String List < String >> get ( URI uri, Map < String List < String >> requestHeaders)

Added in API level 1

Gets all cookies for a specific URI from the cookie cache.

Parameters
uri a URI to search for applicable cookies.
requestHeaders a list of request headers.
Returns
  • an unchangeable map of all appropriate cookies.
Throws
IOException if an error occurs during the I/O operation.

public static CookieHandler getDefault ()

Added in API level 1

Returns the system-wide cookie handler or null if not set.

>)">

public abstract void put ( URI uri, Map < String List < String >> responseHeaders)

Added in API level 1

Sets all cookies of a specific URI in the responseHeaders into the cookie cache.

Parameters
uri the origin URI of the cookies.
responseHeaders a list of request headers.
Throws
IOException if an error occurs during the I/O operation.

public static void setDefault ( CookieHandler cHandler)

Added in API level 1

Sets the system-wide cookie handler.