As Jud pointed out - nsICookieManager needs to be accessed using the
ServiceManager. Sorry bout the confusion.
thnx Jud!
Ashutosh Kulkarni wrote:
> nsICookieService is not a public API. In other words, dont use it. I was
> advised by Jud Valeski to use nsICookieManager. This is IDlized and you can
> access the component using the ComponentManager. The nsICookieManager API
> allows you to iterate through the cookies and remove them individually or
> together. After you get an nsICookie object from the enumerator, you can
> query it for it's string, it's host, etc.
>
> About setting cookies, that is not permitted. Anyways, only the server
> should be allowed to set cookies and the embedding app should not need to
> do this.
>
> _Ashu
>
> [EMAIL PROTECTED] wrote:
>
> > Hi,
> >
> > I am writing a browser (using TestGtkEmbed as a base).
> > I need a way to set cookies from within the browser.
> > There seem to be a cookie service (NS_COOKIESERVICE_CID) that provides a
> > way to Set and get cookies. Unfortunately, I can't get it to work. I
> > looked under mozilla/extensions/cookie/tests, there is a test program
> > called TestCookie.cpp. It uses the (NS_COOKIESERVICE_CID) the way I
> > would like to use it, but the test program causes a segmentation fault
> > on line 44 (nsresult rv = cookieService->SetCookieString(uri, nsnull,
> > (char *)aCookieString);).
> >
> > Does anyone have an idea way this test program is not working?
> > Are there any other good examples of using this cookie service?
> >
> > Any help would be appreciated.
> >
> > Thanks,
> >
> > Andreas
> >
> > Note: I am using Redhat 7.1 and Mozilla 0.9.3
>
> --
> Ashutosh Kulkarni
> Sun Microsystems Inc.
> 408 343 1871
--
Ashutosh Kulkarni
Sun Microsystems Inc.
408 343 1871