1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
38 #include
"nsISupports.idl"
47 * Provides methods for setting and getting cookies in the context of a
48 * page load. See nsICookieManager for methods to manipulate the cookie
49 * database directly. This separation of interface is mainly historical.
51 * This service broadcasts the following notifications when the cookie
52 * list is changed, or a cookie is rejected:
54 * topic : "cookie-changed"
55 * broadcast whenever the cookie list changes in some way. there
56 * are four possible data strings for this notification; one
57 * notification will be broadcast for each change, and will involve
59 * subject: an nsICookie2 interface pointer representing the cookie object
62 * a cookie was deleted. the subject is the deleted cookie.
64 * a cookie was added. the subject is the added cookie.
66 * a cookie was changed. the subject is the new cookie.
68 * the entire cookie list was cleared. the subject is null.
70 * topic : "cookie-rejected"
71 * broadcast whenever a cookie was rejected from being set as a
72 * result of user prefs.
73 * subject: an nsIURI interface pointer representing the URI that attempted
77 [scriptable
, uuid(2aaa897a
-293c
-4d2b
-a657
-8c9b7136996d
)]
78 interface nsICookieService
: nsISupports
81 * Get the complete cookie string associated with the URI.
84 * the URI of the document for which cookies are being queried.
86 * the channel used to load the document. this parameter may be null,
87 * but it is strongly recommended that a non-null value be provided to
88 * ensure that the cookie privacy preferences are honored.
90 * @return the resulting cookie string
92 string getCookieString
(in nsIURI aURI
, in nsIChannel aChannel
);
95 * Get the complete cookie string associated with the URI.
97 * This function is NOT redundant with getCookieString, as the result
98 * will be different based on httponly (see bug 178993)
101 * the URI of the document for which cookies are being queried.
103 * the URI that the user originally typed in or clicked on to initiate
104 * the load of the document referenced by aURI.
106 * the channel used to load the document. this parameter may be null,
107 * but it is strongly recommended that a non-null value be provided to
108 * ensure that the cookie privacy preferences are honored.
110 * @return the resulting cookie string
112 string getCookieStringFromHttp
(in nsIURI aURI
, in nsIURI aFirstURI
, in nsIChannel aChannel
);
115 * Set the cookie string associated with the URI.
118 * the URI of the document for which cookies are being set.
120 * the prompt to use for all user-level cookie notifications.
122 * the cookie string to set.
124 * the channel used to load the document. this parameter may be null,
125 * but it is strongly recommended that a non-null value be provided to
126 * ensure that the cookie privacy preferences are honored.
128 * XXX should be able to allow null aPrompt, since nsIPrompt can be queryied
131 void setCookieString
(in nsIURI aURI
, in nsIPrompt aPrompt
, in string aCookie
, in nsIChannel aChannel
);
134 * Set the cookie string and expires associated with the URI.
136 * This function is NOT redundant with setCookieString, as the result
137 * will be different based on httponly (see bug 178993)
140 * the URI of the document for which cookies are being set.
142 * the URI that the user originally typed in or clicked on to initiate
143 * the load of the document referenced by aURI.
145 * the prompt to use for all user-level cookie notifications.
147 * the cookie string to set.
149 * the expiry information of the cookie (the Date header from the HTTP
152 * the channel used to load the document. this parameter may be null,
153 * but it is strongly recommended that a non-null value be provided to
154 * ensure that the cookie privacy preferences are honored.
156 void setCookieStringFromHttp
(in nsIURI aURI
, in nsIURI aFirstURI
, in nsIPrompt aPrompt
, in string aCookie
, in string aServerTime
, in nsIChannel aChannel
);