I'm having trouble on an iOS app using NSURLSession to login into a website that uses cookies to record successful authentication.
Using the defaultSessionConfiguration() I have no problem. (It even works when the app is in the background and triggered via a Remote Push message.)
When I configure the session to use backgroundSessionConfigurationWithIdentifier() then I can authenticate but the appropriate cookies are not present for subsequent downloads.
The use of backgroundSession fails when the app is in the foreground and the background.
So there must be a difference between default and background that is affecting the cookies. Both configurations are documented as using the shared cookie storage.
Does anybody have an explanation and/or fix for this behavior??