You may have to implement your own persistent storage, but you can use 
NSHTTPCookie to parse the cookie headers.

Also note that cookies are not shared between apps in iOS.

-Jeff


On Jan 8, 2015, at 1:46 PM, Jens Alfke <[email protected]> wrote:

> In the project I work on we've realized* that we need to run NSURLConnections 
> with independent HTTP cookie stores. For instance, a client of our framework 
> could configure multiple replications and have them log in as different 
> Facebook users. (Or the equivalent, for some other auth mechanism that uses 
> session cookies.)
> 
> The problem is that the frameworks don't seem to support this. 
> NSURLCookieStore is essentially a singleton object; at least, there's no API 
> to create instances of it. NSURLConnection can only use the shared instance. 
> NSURLSessionConfiguration does allows some control over cookie storage, but 
> it looks like the only option besides shared is to use non-persistent 
> storage, which doesn't work for us (since FB login cookies need to persist 
> across launches.)
> 
> It kind of looks like we'd have to disable Foundation's cookie handling, 
> parse the Cookie: and Set-Cookie: headers ourselves, and implement our own 
> persistent storage. I really, really don't want to do this, especially 
> because bugs in the way we manage session cookies could result in security 
> holes.
> 
> Is there any other alternative?
> 
> —Jens
> 
> * https://github.com/couchbase/couchbase-lite-ios/issues/543
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Macnetworkprog mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/macnetworkprog/publicposting%40lapcatsoftware.com
> 
> This email sent to [email protected]


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/macnetworkprog/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to