I am trying to send cookies with a URLRequest to a WKWebView in my phone app. This part requires the user to be logged in, therefore I must set my cookies. When I check safari inspection I saw that my cookies are not set and I get redirected to my login page. Here is my code snippet.
var request = URLRequest(url: url)
request.httpMethod = "GET"
request.setValue("cookie1=\(val1);cookie2=\(val2);", forHTTPHeaderField: "Cookie")
request.httpShouldHandleCookies = true
webView.loadRequest(request)