I have a quite ugly problem with a subclassed UIWebView which is maintaining a user's web session with an online backend server, that will communicate with a session object, while the user is logged in to a specific service. From time to time, my app runs a data update service on a background thread with GDC and uses NSURLSessionDataTask to perform backend requests.
The background thread work somehow corrupts the web session object maintained by the UIWebView. In my understanding, that means that the NSHTTPCookieStorage gets corrupted … I don't know this exactly.
I think it would help, if the session maintained by the UIWebView would be shared with any other request done by a NSURLSessionDataTask running in any other thread.
In the past I suppressed the calls to the NSURLSessionDataTask work while the UIWebView session is active - but it seems that under some circumstances one of these calls still come through.
My question though is: How can I share the same session space used by the UIWebView with the NSURLSessionDataTask activities?
Unfortunately, due to the complexity of both implementations, I can't supply sample code…