Erik Haider Forsén 4 years ago
parent
commit
cef0ffb0c0
No account linked to committer's email address
1 changed files with 7 additions and 0 deletions
  1. 7
    0
      apple/RNCWebView.m

+ 7
- 0
apple/RNCWebView.m View File

1282
       for (NSHTTPCookie *cookie in [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]) {
1282
       for (NSHTTPCookie *cookie in [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]) {
1283
         [wkWebViewConfig.websiteDataStore.httpCookieStore setCookie:cookie completionHandler:nil];
1283
         [wkWebViewConfig.websiteDataStore.httpCookieStore setCookie:cookie completionHandler:nil];
1284
       }
1284
       }
1285
+        
1286
+      // Write all cookies from WKWebView back to sharedHTTPCookieStorage
1287
+      [wkWebViewConfig.websiteDataStore.httpCookieStore getAllCookies:^(NSArray* cookies) {
1288
+        for (NSHTTPCookie *cookie in cookies) {
1289
+          [[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookie:cookie];
1290
+        }
1291
+      }];
1285
     } else {
1292
     } else {
1286
       NSMutableString *script = [NSMutableString string];
1293
       NSMutableString *script = [NSMutableString string];
1287
 
1294