title: SFSafariViewController cookies
body: <p>I understand that as of iOS9 you should be able to read cookies with SFSafariViewController.</p>
  
  <p>If I set a cookie on my page in JS using the following:</p>
  
  <pre><code>var dd = new Date(Date.now() + 1000 * 60 * 60 * 24).toGMTString();
  var expires = "expires="+ dd;
  document.cookie = "mycookie=cookievalue; " + expires  + " domain=.mydomain.co.uk ; path=/ ";
  </code></pre>
  
  <p>If I do :</p>
  
  <pre><code>- (void)safariViewController:(SFSafariViewController *)controller didCompleteInitialLoad:(BOOL)didLoadSuccessfully
  {
    NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
    NSArray *cookiesArray = [storage cookies];
  }
  </code></pre>
  
  <p>cookiesArray is always empty.</p>
  
  <p>If I use a traditional UIWebView</p>
  
  <pre><code>-(void)webViewDidFinishLoad:(UIWebView *)webView
  {
    NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
    NSArray *cookiesArray = [storage cookies];
  }
  </code></pre>
  
  <p>I get the cookie I was expecting.</p>
  
  <p>Any ideas what I might be doing wrong?</p>