<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 when there is no WKWebView present"
   href="https://bugs.webkit.org/show_bug.cgi?id=149078">149078</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>WKWebsiteDataStore does not clear cookies when there is no WKWebView present
          </td>
        </tr>

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

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

        <tr>
          <th>Version</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>iOS
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>iOS 9.0
          </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=261022" name="attach_261022" title="Sample app that repros this bug">attachment 261022</a> <a href="attachment.cgi?id=261022&amp;action=edit" title="Sample app that repros this bug">[details]</a></span>
Sample app that repros this bug

The -[WKWebsiteDataStore removeDataOfTypes:] API only clear cookies when there is a WKWebView alive.

This is problematic because WKWebViews can be deallocated at any time during the app's lifecycle and this API should not be dependent on that.

Steps to Reproduce:
1) Run the attached code
2) Click on wv1 that create a WKWebView and loads a page
3) Click on sc1 that sets a persistent cookie with name, value someCookie1=someValue1
4) Click on rc that prints all the cookies, to make sure that this cookie has been set
5) Deallocate this WKWebView by clicking on &quot;deallocate web view&quot;
6) Clear cookies by clicking on &quot;clear cookies&quot;
7) Click on wv1 that recreates the WKWebView and loads a page
6) Wait for the page to load
7) Click on rc to print out all the cookies from the site

Expected Results:
The cookie set earlier (someCookie1) has been removed.

Actual Results:
The cookie set earlier (someCookie1) has not been removed.

Version:
iOS9.0

Configuration:
Any iOS devices.</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>