I'd like to know when a cookie is set in NSHTTPCookieStorage. Is there an on change method or event handler? I'd like to prevent a cookie from being set.
You can listen to the cookie changes by the following notification.
NSHTTPCookieManagerCookiesChangedNotification.
Apple documentation link below.
Example:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(methodYouWantToInvoke) //note the ":" - should take an NSNotification as parameter
name:NSHTTPCookieManagerCookiesChangedNotification
object:nil];