Created attachment 258826 [details] Sample app that repros this bug Multiple WKProcessPools can be created in an app. When -[WKWebsiteDataStore removeDataOfTypes:] is called, it removes cookies from *some* WKProcessPool, and not necessarily from all the WKProcessPools that are currently alive. Since a WKWebsiteDataStore can have multiple WKProcessPools associated with it, it must remove cookies from all the WKProcessPools. Steps to Reproduce: 1) Run the attached code. 2) Click on wv1, which will allocate a WKWebView with a WKProcessPool and load a URL. 3) Click on "sc1", which will set a cookie of name, value someCookie1=someValue1 4) Click on "deallocate web views", which will deallocate all WKWebViews 5) Click on wv2, which will allocate a WKWebView with a *different* WKProcessPool and load a URL. 6) Click on "sc2", which will set a cookie of name, value someCookie2=someValue2 7) Click on "deallocate web views", which will deallocate all WKWebViews 8) Click on "Clear cookies" 9) Click on wv1 10) Click on "rc", to read all cookies 11) Click on "deallocate web views" 12) Click on wv2 13) Click on "rc", to read all cookies Expected Results: The cookies someCookie1, someCookie2 should be removed Actual Results: The cookies someCookie1, someCookie2 are not removed. In some scenarios (when this experiment is run numerous time) only one of the cookies is removed. Configuration: Device
rdar://22240544