开发者

iPhone Facebook connect : "Cookies required"

I am using Faceb开发者_如何学CookConnect 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,


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


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 policcy is NSHTTPCookieAcceptPolicyAlways, so if you are experiencing this issue while loging 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜