<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - WKWebsiteDataStore does not clear cookies from all WKProcessPools"
   href="https://bugs.webkit.org/show_bug.cgi?id=147936">147936</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>WKWebsiteDataStore does not clear cookies from all WKProcessPools
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>528+ (Nightly build)
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>WebKit2
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>shreyasv&#64;chromium.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=258826" name="attach_258826" title="Sample app that repros this bug">attachment 258826</a> <a href="attachment.cgi?id=258826&amp;action=edit" title="Sample app that repros this bug">[details]</a></span>
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 &quot;sc1&quot;, which will set a cookie of name, value someCookie1=someValue1
4) Click on &quot;deallocate web views&quot;, 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 &quot;sc2&quot;, which will set a cookie of name, value someCookie2=someValue2
7) Click on &quot;deallocate web views&quot;, which will deallocate all WKWebViews
8) Click on &quot;Clear cookies&quot;
9) Click on wv1
10) Click on &quot;rc&quot;, to read all cookies
11) Click on &quot;deallocate web views&quot;
12) Click on wv2
13) Click on &quot;rc&quot;, 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</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>