'Convert WKWebView to UrlSession?

I understand that WkWebview handles loading and presenting webpages and resources. I'd like to export a wkWebview object to a URLSession. How can I do this while keeping all of the credentials and authentication that the wkwebview has captured. I tried to copy over the cookies however, I still receive an error from the urlsession that I do not have authorization.

Any ideas?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source