Search code examples
facebookfacebook-opengraphfacebook-timeline

Open Graph actions links and Facebook connect


When users click on our action link on timeline, they are being asked to add the app with its proper permissions and then redirected to the object page on our website. But, when they do so, they dont become facebook-logged in to the website until they click "facebook connect" button which refreshes the page and makes them logged-in. Any comments are highly appreciated.


Solution

  • Well, they can’t be logged in, because Facebook hasn’t had a chance yet to set a cookie under your domain in your current flow.

    Embed the JS SDK and call FB.getLoginStatus for users have arive that way, and have your page reload in the callback function (you might want to check success first, because you never know …) Then you should have them logged in. (Make sure to set cookie-parameter to true in FB.init. And make sure to call FB.getLoginStatus + reload only once.)