Bug 210235

Summary: Cookies still exist after data removal of WKWebsiteDataStore
Product: WebKit Reporter: Sihui Liu <sihui_liu>
Component: WebKit2Assignee: Sihui Liu <sihui_liu>
Status: NEW ---    
Severity: Normal CC: achristensen
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch achristensen: review-

Description Sihui Liu 2020-04-08 18:41:42 PDT
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.
Comment 1 Sihui Liu 2020-04-08 18:53:22 PDT
Created attachment 395899 [details]
Patch
Comment 2 Alex Christensen 2020-04-09 10:15:09 PDT
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.
Comment 3 Alexey Proskuryakov 2020-04-09 16:22:42 PDT
iOS API test failures seem related.
Comment 4 Alex Christensen 2020-04-09 17:18:35 PDT
Comment on attachment 395899 [details]
Patch

definitely