Reproducible steps: 1. Store some cookies on disk(can be done and verified with WKHTTPCookieStore's API), then quit app (make sure no cookie storage in memory). 2. Remove all data of default session with WKWebsiteDataStore's removeDataOfTypes. 3. Get cookies with WKHTTPCookieStore's API. The cookies count is not zero. The problem is that UI process and network process are accessing the same cookie storage file. Cookie removal of step 2 is done in the network process and cookie retrieval of step 3 is done in the UI process (because there is no processpool). UI process may read the cookie storage file into memory before data removal of step 2, and not update in-memory storage properly.
Created attachment 395899 [details] Patch
Comment on attachment 395899 [details] Patch An extra flush won't hurt. Eventually https://bugs.webkit.org/show_bug.cgi?id=203547 will really fix this.
iOS API test failures seem related.
Comment on attachment 395899 [details] Patch definitely