2
votes

I have an iOS app that uses a UIWebView to display pages from a ASP.Net Site. The user logs into the site through the UIWebView, which creates the forms authentication cookie and authenticates any further page loads in the UIWebView. I'm attempting to use this same cookie to authenticate some http requests that are done with a ASIHttpRequest.

Supposedly this should happens automatically, but it wasn't working. I'm now explicitly setting the cookie for ASP.NET_SessionId on the ASIHttpRequest, and the request is still not authenticated, it ends up redirected to a login page.

Is there something in the forms authentication cookie that would make it specific to the UIWebView where it wouldn't also work with an ASIHttpRequest?

1

1 Answers

2
votes

Ah, apparently this was related to ASP.Net not recognizing that the UIWebView browser supported cookies. (even though the authentication mostly worked in the UIWebView)

I added the generic.browser file as seen in this other question - Asp.Net Forms Authentication when using iPhone UIWebView