There is this new great method of NSHTTPCookieStorage
, available since MacOS 10.10 and iOS 8.0. Guessing from the negligible number of Google hits, nobody much has noticed it yet. Not so surprising, given that it's not yet even in the Apple dev portal docs, just in header. But i still hope someone knows how to use it, because i don't :) I'm trying to use it for clearing all cookies instead of the embarrassing cookie jar iteration. So i have called it with
[NSDate dateWithTimeIntervalSince1970:0]
and BOOM, EXC_BAD_ACCESS
in MemoryCookies::visitCookies
. Ok UN*X epoch was too mean, probably. So i tried
[NSDate dateWithTimeIntervalSinceNow:-86400];
and BOOM again. So i continued dividing interval and found out that it indeed wants at least one cookie at least as old as the date
parameter. So you would have to iterate cookies anyway to find the oldest one and then call the new shiny method. It's so ridiculously impractical that i even dare to call it a bug.
Thoughts?