Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSHTTPCookieStorage doesn't provide the most current set of cookies.



Hi Lists,

I'm currently working on a little app and in my app I need to monitor the [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies].

In my app I have an NSTimer which fires every 3 seconds to print the contents of the shared cookie storage. What I am noticing is that the contents of the array returned by [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies] doesn't seem to be the most current.

For example, when I clear all my cookies in Safari then run my app, it will show the cookies as empty which is correct. Now when I load numerous sites in Safari, I can see through the logs in the Console that my app is still printing cookies as empty when it shouldn't. However when I make my app as the active app, it then notices the change in the shared cookies then prints the cookies that just got loaded. My app only seems to notice changes in the cookies when I make it the current app.

I need a way to monitor for changes in the cookie storage immediately and have my app perform a task even if it is not the current app.
I tried registering for the NSHTTPCookieManagerCookiesChangedNotification notification but I was getting the same results as I mentioned above. My app would only get the notification if I made it active.


Am I missing something on how to use NSHTTPCookieStorage sharedHTTPCookieStorage and how the cookies are updated? I thought it would be immediate?

Thanks.
-r
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.