Hello,
I am trying to use the nsICookieManager2 interface of the "@mozilla.org/cookiemanager;1" component to add cookies to the browser. Unfortunately, the nsICookieManager2 is not scriptable so I cannot call it directly from JavaScript. So I wrote "wrapper" XPCOM component in C++ that calls the nsICookieManager2 to add the cookie. Reference to the nsICookieManager2 interface can be found here:
http://www.xulplanet.com/references/xpcomr...ieManager2.htmlThe component I wrote is very simple and just for testing I wrote something like that:
So the call to the cookiemanager is done correctly, my "rv" variable does not show a failure. However, the cookie is NOT added to the browser. I am using firefox-1.0.4.
I had a look at the lxr.mozilla to see how the cookiemanager is used. I found the following code:
http://lxr.mozilla.org/seamonkey/source/ex...ncesWin.cpp#540Function "CopyCookiesFromBuffer()" calls the cookiemanager on line #618.
I am using the cookiemanager in the same way but yet no cookies are added.
Any help and suggestions are welcome.
Thanks
ministre