WKWebView observe cookies changes

Hello

According to wwdc 17 there is a way to observe cookies changes in WKWebView in iOs 11 (WebsiteDataStore.httpCookieStore).

Could you provide example how to do that?

Replies

I found that there is WKHTTPCookieStoreObserver and it has cookiesDidChange member.


So i put that protocol as following

class ActivitiesViewController: UIViewController, UIGestureRecognizerDelegate, WKNavigationDelegate, WKHTTPCookieStoreObserver {


and

func cookiesDidChange(in cookieStore: WKHTTPCookieStore) {


but cookiesDidChange not fires (

Did you solve this? I have same problem - the cookiesDidChange callback is not being called reliably.