Skip to content

Most visited

Recently visited

navigation
Added in API level 9

CookiePolicy

public interface CookiePolicy

java.net.CookiePolicy


CookiePolicy has three pre-defined policy. They are ACCEPT_ALL, ACCEPT_NONE and ACCEPT_ORIGINAL_SERVER respectively. They are used to decide which cookies should be accepted and which should not be. See RFC 2965 sections 3.3 and 7 for more detail.

Summary

Fields

public static final CookiePolicy ACCEPT_ALL

A pre-defined policy, accepts all cookies.

public static final CookiePolicy ACCEPT_NONE

A pre-defined policy, accepts no cookies at all.

public static final CookiePolicy ACCEPT_ORIGINAL_SERVER

A pre-defined policy, only accepts cookies from original server.

Public methods

abstract boolean shouldAccept(URI uri, HttpCookie cookie)

This method is used to determine whether or not the specified cookie should be accepted.

Fields

ACCEPT_ALL

Added in API level 9
CookiePolicy ACCEPT_ALL

A pre-defined policy, accepts all cookies.

ACCEPT_NONE

Added in API level 9
CookiePolicy ACCEPT_NONE

A pre-defined policy, accepts no cookies at all.

ACCEPT_ORIGINAL_SERVER

Added in API level 9
CookiePolicy ACCEPT_ORIGINAL_SERVER

A pre-defined policy, only accepts cookies from original server.

Public methods

shouldAccept

Added in API level 9
boolean shouldAccept (URI uri, 
                HttpCookie cookie)

This method is used to determine whether or not the specified cookie should be accepted.

Parameters
uri URI: the URI to used to determine acceptability
cookie HttpCookie: the HttpCookie to be determined
Returns
boolean true if this cookie should be accepted; false otherwise
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.