> On Jul 16, 2015, at 3:37 AM, Mirko Viviani <mi...@objectlab.org> wrote:
> 
> I’m using the following code for FaceBook authentication with custom cookie 
> management (-setHTTPShouldHandleCookies:NO),
> but recently it has stopped working with a web message ‘Cookies are not 
> enabled’.

Have you set breakpoints or added logging to examine what headers you’re 
sending in your requests, and what you’re getting in the responses?

>        NSDictionary *headers = [NSHTTPCookie 
> requestHeaderFieldsWithCookies:cookies];
>        NSString *cookieHeader = [headers objectForKey:@"Cookie"];
>        if (cookieHeader) {
>            [mutableRequest setValue:cookieHeader 
> forHTTPHeaderField:@"Cookie"];
>        }

I think the intent of +requestHeaderFieldsWithCookies: is that you should add 
all the returned headers to the request. In practice this might just be a 
single “Cookie:” header, but it’s probably best not to second-guess the 
framework.

—Jens
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to