title: How do I set Cookies on WkWebView on Swift?
body: <p>I'm trying to set a <code>WKWebView</code> in my <code>iOS</code> app and set a cookie with the authentication info but I couldn't find a way to set cookies in Swift. I saw some questions but all the answers were in <code>Objective-C</code>. I tried to do some ideas for a Swift solution but I am also new in iOS development. I tried to do something like:</p>
  
  <pre><code>let request = NSMutableURLRequest(url: myUrl! as URL)
  request.addValue("CookieKey=value", forHTTPHeaderField: "Cookie")
  </code></pre>
  
  <p>but it didn't work. When I load the page the cookies have not been set. Can any one help me?</p>