Bug 210235 - Cookies still exist after data removal of WKWebsiteDataStore
Summary: Cookies still exist after data removal of WKWebsiteDataStore
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sihui Liu
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-08 18:41 PDT by Sihui Liu
Modified: 2020-04-09 17:18 PDT (History)
1 user (show)

See Also:


Attachments
Patch (5.24 KB, patch)
2020-04-08 18:53 PDT, Sihui Liu
achristensen: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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