Created attachment 348177 [details] sample project On iOS 12 beta 10 (and earlier), the WKHTTPCookieStoreObserver cookiesDidChange method is not being consistently called. We use the WKHTTPCookieStoreObserver to synchronize login state. Our login occurs in WKWebView which sets cookies with authentication tokens. We then transfer those cookies to our NSURLSession requests to our direct API. As of iOS 12 beta, the WKHTTPCookieStoreObserver, cookiesDidChange method seems to be getting called inconsistently. During debugging (via logs) we see it getting called for some initial requests and then it just stops being called. Attached a sample project that demonstrates issue. Callback is called on initial page load. When you perform a search, cookies are modified, but the observer is never notified. Radar: 43691855
(In reply to bchenindeed from comment #0) > Created attachment 348177 [details] > sample project > > On iOS 12 beta 10 (and earlier), the WKHTTPCookieStoreObserver > cookiesDidChange method is not being consistently called. > > We use the WKHTTPCookieStoreObserver to synchronize login state. Our login > occurs in WKWebView which sets cookies with authentication tokens. We then > transfer those cookies to our NSURLSession requests to our direct API. > > As of iOS 12 beta, the WKHTTPCookieStoreObserver, cookiesDidChange method > seems to be getting called inconsistently. During debugging (via logs) we > see it getting called for some initial requests and then it just stops being > called. > > Attached a sample project that demonstrates issue. Callback is called on > initial page load. When you perform a search, cookies are modified, but the > observer is never notified. > > Radar: 43691855 Hi Brian, thanks for providing the test case. This is a known issue and it's not a webkit bug. We are working on a fix. What we found is the cookie was set successfully but notification of changes was not sent, so a workaround may be using [WKHTTPCookieStore getAllCookies:] inside decidePolicyForNavigationRespons?
Marking as invalid as this is an issue outside WebKit. Thank you again for the report!