简体   繁体   English

Facebook API-使用JSSDK登录,在后端使用php SDK

[英]Facebook API - login with JSSDK use php sdk in back end

I'm working on this web application that I use the FB JSSDK to log the user in, on some other page in the back end I want to do some functions like: 我正在使用FB JSSDK登录该用户的Web应用程序,在后端的其他页面上,我想执行以下功能:

$user_profile = $facebook->api('/me');

For this first I need to do this: 首先,我需要这样做:

$config = array(
          'appId' => 'xxx',
          'secret' => 'xxx',
          'cookie' => true,
          'fileUpload' => false, 
          'allowSignedRequest' => false,
      );

      $facebook = new Facebook($config);


      return $facebook;

I've already logged in once with JSSDK, is the a way to read the cookie or somehow use the php functions without logging again? 我已经使用JSSDK登录过一次,这是一种读取cookie或以某种方式使用php函数而无需再次登录的方法吗?

$facebook->getMetadataCookie()

would return all the contents of authentication cookie. 将返回身份验证Cookie的所有内容。

But you better explain what do you need it for. 但是您最好解释一下您需要什么。

References: 参考文献:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM