I am loading a WKWebview and setting up a cookie. The server is receiving it correctly.
The web page that is loaded is making more calls to the server to load other resources: css, js, etc.
How to make sure the cookie I set in the first call is used for all the subsequent calls?
Here is a part of the code:
let requestUrl = URL(string: url)
var request = URLRequest(url: requestUrl!)
let cookie = “cookieName=" + cookieValue
request.addValue(cookie, forHTTPHeaderField: "Cookie")
let webConfiguration = WKWebViewConfiguration()
wkWebView = WKWebView(frame: .zero, configuration: webConfiguration)
self.view.addSubview(wkWebView)
wkWebView.load(request)