<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>147635</bug_id>
          
          <creation_ts>2015-08-04 11:08:59 -0700</creation_ts>
          <short_desc>WKWebsiteDataStore does not always clear cookies</short_desc>
          <delta_ts>2015-08-10 17:55:31 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit2</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=147333</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Shreyas VA">shreyasv</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>andersca</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1114653</commentid>
    <comment_count>0</comment_count>
    <who name="Shreyas VA">shreyasv</who>
    <bug_when>2015-08-04 11:08:59 -0700</bug_when>
    <thetext>WKWebsiteDataStore does not clear cookies in the following scenarios:
1) WKWebView has been just created
2) There is no WKWebView attached to the WKWebViewConfiguration

(there maybe more scenarios, these are the known ones)


Sample code to run:

WKWebViewConfiguration* config = [[WKWebViewConfiguration alloc] init];
  self.webView =
      [[WKWebView alloc] initWithFrame:CGRectZero configuration:config];

  [self.view addSubview:self.webView];

  NSString* url = @&quot;http://google.com&quot;;
  [self.webView loadRequest:
      [NSURLRequest requestWithURL:[NSURL URLWithString:url]]];

// Trigger clearing of cookies.
 [self.webView.configuration.websiteDataStore removeDataOfTypes:[NSSet setWithObject:WKWebsiteDataTypeCookies]
                                                     modifiedSince:[NSDate distantPast] completionHandler:^{
                                                       // Notice that this is not called.
                                                       NSLog(@&quot;Cleared cookies&quot;);
                                                     }];

Expected Results:
The completion handler is called and cookies are cleared.

Actual Results:
The completion handler is not called and cookies are not cleared.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1114655</commentid>
    <comment_count>1</comment_count>
    <who name="Shreyas VA">shreyasv</who>
    <bug_when>2015-08-04 11:09:16 -0700</bug_when>
    <thetext>rdar://22120241</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1115040</commentid>
    <comment_count>2</comment_count>
    <who name="Anders Carlsson">andersca</who>
    <bug_when>2015-08-05 10:18:32 -0700</bug_when>
    <thetext>I can&apos;t reproduce this, can you please attach a test app that shows the problem?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1115050</commentid>
    <comment_count>3</comment_count>
    <who name="Shreyas VA">shreyasv</who>
    <bug_when>2015-08-05 10:37:24 -0700</bug_when>
    <thetext>Reproducibility on simulator
0/5

Reproducibility on device
5/5

Or in other words this bug only affects device builds.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1116422</commentid>
    <comment_count>4</comment_count>
    <who name="Shreyas VA">shreyasv</who>
    <bug_when>2015-08-10 17:55:31 -0700</bug_when>
    <thetext>I can&apos;t repro this bug anymore.

Please note that this is different from bug 147333. This bug also states that the completionHandler is not called.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>