to top
Android APIs
Since: 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

Since: API Level 9

A pre-defined policy, accepts all cookies.

public static final CookiePolicy ACCEPT_NONE

Since: API Level 9

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

public static final CookiePolicy ACCEPT_ORIGINAL_SERVER

Since: API Level 9

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

Public Methods

public abstract boolean shouldAccept (URI uri, HttpCookie cookie)

Since: 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