For these purposes, let say I have an application which contains a single UIWebview.
I'm loading a request to any of these sites: facebook, gmail, twitter, etc., and receive a login screen.
The thing is - that if I log in and relaunch the app, I will have to go through the login screen again.
In Mobile Safari/Google app for example I would retain my login cookie/session details/whatnot and wouldn't need to enter my user credentials again. That is the behavior I want to have.
Stuff I tried:
How can I achieve the behavior Mobile Safari & Google app has?
The cookies should be archived and persisted when the app is terminated and later reloaded when the app becomes active. You can achieve this by:
[[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookies:cookies forURL:url mainDocumentURL:nil]; // where cookies is the unarchived array of cookies
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With