Skip to content

Instantly share code, notes, and snippets.

@BramYeh
Created March 29, 2017 12:23
Show Gist options
  • Save BramYeh/ed05e312be2c569f564e04066783c301 to your computer and use it in GitHub Desktop.
Save BramYeh/ed05e312be2c569f564e04066783c301 to your computer and use it in GitHub Desktop.
Add cookies into request that webview loads requests
// assume request is original request you want wkwebview to load
NSMutableURLRequest *mutableRequest = [request mutableCopy];
[mutableRequest setValue:"CookieKey = CookieValue" forHTTPHeaderField:@"Cookie"];
// navigates to a requested URL
[self.webView loadRequest:mutableRequest];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment