mozilla
Your Search Results

    nsICookieManager

    An optional interface for accessing or removing the cookies that are in the cookie list.

    Please add a summary to this article.
      Last changed in Gecko 1.7

    Inherits from: nsISupports

    This interface is intended to be used as a service. To create an object implementing this interface:

    var cookieManager = Components.classes["@mozilla.org/cookiemanager;1"]
                        .getService(Components.interfaces.nsICookieManager);
    

    Method overview

    void remove(in AUTF8String aHost, in ACString aName, in AUTF8String aPath, in boolean aBlocked);
    void removeAll();

    Attributes

    Attribute Type Description
    enumerator nsISimpleEnumerator Called to enumerate through each cookie in the cookie list. The objects enumerated over are of type nsICookie. Read only.

    Methods

    remove()

    This method is called to remove an individual cookie from the cookie list, specified by host, name, and path. If the cookie cannot be found, no exception is thrown. Typically, the arguments to this method will be obtained directly from the desired nsICookie object.

    void remove(
      in AUTF8String aHost,
      in ACString aName,
      in AUTF8String aPath,
      in boolean aBlocked
    );
    
    Parameters
    aHost
    The host or domain for which the cookie was set. See nsICookieManager2.add() for a description of acceptable host strings. If the target cookie is a domain cookie, a leading dot must be present.
    aName
    The name specified in the cookie.
    aPath
    The path for which the cookie was set.
    aBlocked
    Indicates if cookies from this host should be permanently blocked.

    removeAll()

    This method is called to remove all cookies from the cookie list.

    void removeAll();
    
    Parameters

    None.

    See also

    Document Tags and Contributors

    Contributors to this page: trevorh
    Last updated by: trevorh,