AP.
AP.

Reputation: 5323

iPhone Facebook connect : "Cookies required"

I am using FacebookConnect on the iPhone to integrate my app with Facebook. Unfortunatly I've always "cookies required" when trying to login.

Are you also encountering this issue or do you know what may cause this issue?

Thanks in advance for your help :)

Regards,

Upvotes: 0

Views: 1879

Answers (2)

Jasprit S. Gill
Jasprit S. Gill

Reputation: 11

Yes, you can change the settings for enabling / disabling cookies programmatically in iOS. NSHTTPCookieStorage is the class used for this.

Here is how you enable it:

[[NSHTTPCookieStorage sharedHTTPCookieStorage]
 setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];

Be informed that this is a shared cookie storage that is universal to the app you are using it in. Cookies are not shared among the apps in iOS due to sandbox architecture.

The default value of this policy is NSHTTPCookieAcceptPolicyAlways, so if you are experiencing this issue while logging in through Facebook connect, there are high chances that you have set its value explicitly to NSHTTPCookieAcceptPolicyNever (or altered it to some other) somewhere else in the app, and this is the side effect of that.

Upvotes: 1

zoul
zoul

Reputation: 104065

Do you have cookies enabled in Settings → Safari → Accept Cookies?

Upvotes: 1

Related Questions