IT. Expert System.

Android Reference

CookieManager


android.webkit

Class CookieManager



  • public class CookieManager
    extends Object
    Manages the cookies used by an application's WebView instances. Cookies are manipulated according to RFC2109.
    • Constructor Detail

      • CookieManager

        protected CookieManager()
    • Method Detail

      • clone

        protected Object clone()
                        throws CloneNotSupportedException
        Description copied from class: Object
        Creates and returns a copy of this Object. The default implementation returns a so-called "shallow" copy: It creates a new instance of the same class and then copies the field values (including object references) from this instance to the new instance. A "deep" copy, in contrast, would also recursively clone nested objects. A subclass that needs to implement this kind of cloning should call super.clone() to create the new instance and then create deep copies of the nested, mutable objects.
        Overrides:
        clone in class Object
        Returns:
        a copy of this object.
        Throws:
        CloneNotSupportedException - if this object's class does not implement the Cloneable interface.
      • setAcceptCookie

        public void setAcceptCookie(boolean accept)
        Sets whether the application's WebView instances should send and accept cookies.
        Parameters:
        accept - whether WebView instances should send and accept cookies
      • acceptCookie

        public boolean acceptCookie()
        Gets whether the application's WebView instances send and accept cookies.
        Returns:
        true if WebView instances send and accept cookies
      • setCookie

        public void setCookie(String url,
                     String value)
        Sets a cookie for the given URL. Any existing cookie with the same host, path and name will be replaced with the new cookie. The cookie being set must not have expired and must not be a session cookie, otherwise it will be ignored.
        Parameters:
        url - the URL for which the cookie is set
        value - the cookie as a string, using the format of the 'Set-Cookie' HTTP response header
      • getCookie

        public String getCookie(String url)
        Gets the cookies for the given URL.
        Parameters:
        url - the URL for which the cookies are requested
        Returns:
        value the cookies as a string, using the format of the 'Cookie' HTTP request header
      • getCookie

        public String getCookie(String url,
                       boolean privateBrowsing)
        Parameters:
        url - the URL for which the cookies are requested
        privateBrowsing - whether to use the private browsing cookie jar
        Returns:
        value the cookies as a string, using the format of the 'Cookie' HTTP request header
      • getCookie

        public String getCookie(WebAddress uri)
        Gets cookie(s) for a given uri so that it can be set to "cookie:" in http request header.
        Parameters:
        uri - the WebAddress for which the cookies are requested
        Returns:
        value the cookies as a string, using the format of the 'Cookie' HTTP request header
      • removeSessionCookie

        public void removeSessionCookie()
        Removes all session cookies, which are cookies without an expiration date.
      • removeAllCookie

        public void removeAllCookie()
        Removes all cookies.
      • hasCookies

        public boolean hasCookies()
        Gets whether there are stored cookies.
        Returns:
        true if there are stored cookies
      • hasCookies

        public boolean hasCookies(boolean privateBrowsing)
        Parameters:
        privateBrowsing - whether to use the private browsing cookie jar
      • removeExpiredCookie

        public void removeExpiredCookie()
        Removes all expired cookies.
      • flushCookieStore

        protected void flushCookieStore()
        Flushes all cookies managed by the Chrome HTTP stack to flash.
      • allowFileSchemeCookies

        public static boolean allowFileSchemeCookies()
        Gets whether the application's WebView instances send and accept cookies for file scheme URLs.
        Returns:
        true if WebView instances send and accept cookies for file scheme URLs
      • setAcceptFileSchemeCookies

        public static void setAcceptFileSchemeCookies(boolean accept)
        Sets whether the application's WebView instances should send and accept cookies for file scheme URLs. Use of cookies with file scheme URLs is potentially insecure. Do not use this feature unless you can be sure that no unintentional sharing of cookie data can take place.

        Note that calls to this method will have no effect if made after a WebView or CookieManager instance has been created.



Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 3251 / . Delta: 0.04898 с