iOS Swift WKWebView login with Session
<p>I come from UIWebView where I had following code:</p>

<pre><code>         let url2 = NSURL(string: URL+"/auth?id="+self.username!+"&amp;pw="+self.password!)                    
            let task2 = NSURLSession.sharedSession().dataTaskWithURL(url2!) {(data, response, error) in
                print(NSString(data: data!, encoding: NSUTF8StringEncoding))
            }

            task2.resume()
</code></pre>

<p>Doing this I was automatically logged in.
But now with the WKWebView this is not working anymore.</p>

<p>The Code is executed just before loading the request:</p>

<pre><code>  self.webView = WKWebView()
  let request = NSURLRequest(URL: portalURL!)
  self.webView!.loadRequest(request)
</code></pre>

<p>Username and Password are stored on the Device, when the User installs the Application.</p>

<p>How can I get a similar effect with WKWebView?</p>