Re: Multiple independent cookie stores?
Re: Multiple independent cookie stores?
- Subject: Re: Multiple independent cookie stores?
- From: Jeff Johnson <email@hidden>
- Date: Thu, 08 Jan 2015 13:55:50 -0600
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@hidden> 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@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden