Re: Delay in reading cookie using NSHttpCookieStorage
Re: Delay in reading cookie using NSHttpCookieStorage
- Subject: Re: Delay in reading cookie using NSHttpCookieStorage
- From: Fritz Anderson <email@hidden>
- Date: Wed, 06 Jul 2011 09:38:49 -0500
On 5 Jul 2011, at 7:57 AM, Hirendra Rathor wrote:
> I experimented further and waited for few seconds after the 'alert' dialog box was displayed. Since I did not dismiss the dialog box, my application was also not launched. After a while I saw the content of the cookie in Cookies.plist changed to Cookie-B. I dismissed the dialog and let the application launch. I saw the application receiving correct value of the cookie.
>
> Why does it take this long for the cookie value to change in Cookies.plist file? Is this delay also responsible for application to receive stale cookie or is it just coincidental?
The same problem came up in <http://lists.apple.com/archives/macnetworkprog/2007/Apr/msg00001.html>. Jerry Krinock seemed not to get any answer, and resorted to having the consuming application delay for 10 seconds before reading a cookie.
When information is cached by one process, it's not uncommon to coalesce changes by accumulating them into one big update, rather than incur the expense of flushing each one into the persistent store as it occurs. It doesn't surprise me that there's a delay.
Your problem looks to me like a common use case for the policy hurting functionality. File a bug at bugreport.apple.com and ask that it be changed.
(devforums.apple.com does not disappoint: When I searched for "NSHTTPCookieStorage delay" it came up with no matches, but offered "Shortcakes delay." Developer-forum discussions can't get beyond three or four messages without shortcakes coming up one way or another.)
— F
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden