Join MDN and developers like you at Mozilla's View Source conference, 12-14 September in Berlin, Germany. Learn more at https://viewsourceconf.org

nsICookiePromptService

The nsICookiePromptService interface is to open a dialog to ask to permission to accept the cookie.

Please add a summary to this article.
  Last changed in Gecko 1.9 (Firefox 3)

Inherits from: nsISupports

Method overview

long cookieDialog(in nsIDOMWindow parent, in nsICookie cookie, in ACString hostname, in long cookiesFromHost, in boolean changingCookie, out boolean rememberDecision);

Constants

Constant Value Description
DENY_COOKIE 0 Holds the value for a denying the cookie.
ACCEPT_COOKIE 1 Holds the value for accepting the cookie.
ACCEPT_SESSION_COOKIE 2 Holds the value for accepting the session cookie.

Methods

cookieDialog()

Opens a dialog that asks for permission to accept a cookie.

 long cookieDialog(
   in nsIDOMWindow parent,
   in nsICookie cookie,
   in ACString hostname,
   in long cookiesFromHost,
   in boolean changingCookie,
   out boolean rememberDecision
 );
Parameters
parent
The parent window for the dialog.
cookie
The cookie about which permission is being requested.
hostname
The host that wants to set the cookie, not the domain; this is part of the cookie.
cookiesFromHost
The number of cookies there are already for this host.
changingCookie
Are we changing this cookie?
rememberDecision
Should we set the matching permission for this host?
Return value

Returns 0 for denying a cookie, 1 for accepting a cookie, and 2 for accepting cookie for the current session only.

See also

Document Tags and Contributors

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