to top
Android APIs
Added in API level 9
public interface

CookiePolicy

java.net.CookiePolicy

Class Overview

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

public static final CookiePolicy ACCEPT_ALL

Added in API level 9

A pre-defined policy, accepts all cookies.

public static final CookiePolicy ACCEPT_NONE

Added in API level 9

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

public static final CookiePolicy ACCEPT_ORIGINAL_SERVER

Added in API level 9

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

Public Methods

public abstract boolean shouldAccept (URI uri, HttpCookie cookie)

Added in API level 9

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

Parameters
uri the URI to used to determine acceptability
cookie the HttpCookie to be determined
Returns
  • true if this cookie should be accepted; false otherwise