0
votes

I have a UIWebView in my app that accesses a particular page login, if I enter using the existing webview in my application it appears that the session or cookie are unsaved (and I can't go ahead).

But if I try the same thing using the browser Safari from my device, it can store the sessions or cookies and log in.

This is my code to load the page:

@IBOutlet weak var webView: UIWebView!

 override func viewDidLoad() {
 UIWebView.loadRequest(webView)(NSURLRequest(URL: NSURL(string: "http://stackoverflow.com")!))
        webView.delegate = self
 }

Why he is not saving sessions or cookies, and how can I solve this, it is possible?

1

1 Answers

0
votes

Lcarifilm!

The WebView should technically function like a regular browser. You could try and implement webViewDidFinishLoad() and detect a certain URL that may indicate you have successfully logged in to the website, and following detection, simply generate another loadRequest to the particular page you were referring to.

Hope that helped :)