开发者

After facebook invitation and return, all my session gone

开发者 https://www.devze.com 2023-02-06 21:21 出处:网络
I want to let customer invite friends inside my开发者_JAVA技巧 website customer area. After customer login to my website customer area, all the personal session datas created as usual.

I want to let customer invite friends inside my开发者_JAVA技巧 website customer area.

After customer login to my website customer area, all the personal session datas created as usual.

Then customer click to facebook connect, grant permission and being shown a list of friends that they can tick to invite.

Once the invitation done and back to the same page again, all my website session datas gone. Only left the facebook sessions (access_token, base_domain, expires, secret, session_key, sig)

I wonder how come...

I want back all my existing session datas in order to perform other activities.

Any way to get back?

session_start();

if($_SESSION["username"]=="") {

}

$facebook = new Facebook(array(

    'appId'  => $fbconfig['appid'],

    'secret' => $fbconfig['secret'],

    'cookie' => true,
));

$sessionfb = $facebook->getSession();

//this facebook getsession is using the latest facebook.php provided as part of the sdk

$loginUrl = $facebook->getLoginUrl(

    array(
      'canvas'    => 1,

            'fbconnect' => 0,

            'req_perms' => 'email,publish_stream,status_update,user_birthday' )
);

$fbme = null;

print_r($_SESSION);

<fb:serverFbml style="width: 500px;">
    <script type="text/fbml">
      <fb:fbml>
          <fb:request-form
                    action="<?=$fbconfig['baseUrl']?>/index.php"
                    target="_top"
                    method="POST"
                    invite="true"
                    type="testing"
                    content="testing <fb:req-choice url='<?=$fbconfig['appBaseUrl']?>' label='Accept' />"
                    >

                    <fb:multi-friend-selector
                    showborder="false"
                    actiontext="testing ">
        </fb:request-form>
      </fb:fbml>
    </script>
</fb:serverFbml>  


As for as I know in login url when you use canvas=1, fbconnect=0 then it means that you have an facebook application within facebook. you are specifying canvas=1 and fbconnect=0. If you are embedding facebook in your site then you must do the contrast. fbconnect=0 means you are not embedding facebook in your site.

0

精彩评论

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