Question

I have an application which has a login page resides on the application server. So I open a UIWebView to handle the login. After then I want to switch to the UIView and make API calls using ASIHttp library (others may also be acceptable). The problem is; after I login server keeps session object for authentication purpose, so when I close the UIWebView and switch to a UIView and make an API call, it fails. I believe, somehow I need to maintain session object (set after login) in the API calls. How can I achieve this?

Was it helpful?

Solution

Here are the steps I followed:

  • Extract the cookies in UIWebView using NSHTTPCookieStorage class.
  • Send it back using ASIHTTPRequest setRequestCookies: method for the subsequent calls
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top