OAuthException:必须使用活动的访问令牌来查询有关当前user.loggain的信息。
事情是,第一次工作完美,但3次尝试它给我的错误...
用户可以借用一个免费的商店和用户的工具可以借用4个工具..每次用户执行步骤后,我刷新页面和3-4刷新后,我得到错误
<?php header('P3P:CP =CURA ADMa DEVA PSAO PSDO我们的总线UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR') ; 需要php / facebook.php; require'php / faceconf.php'; $ facebookoklog =; $ facebookoklog1 =; $ facebookok =; $ facebook = new Facebook(array('appId'=> $ appID,'secret'=> $ appSecret,)); $ user = $ facebook-> getUser(); if(empty($ user)){ global $ facebookok; $ facebookok =getill; } elseif($ user){ try { //获取Facebook用户个人资料 $ user_profile = $ facebook-> api('/ me ); $ _SESSION ['User'] = $ user_profile; } catch(FacebookApiException $ e){ global $ facebookoklog; global $ facebookoklog1; $ facebookoklog =loggain; $ facebookoklog1 = $ e; } } if($ facebookoklog ==loggain|| $ facebookok ==getill){//执行此操作} else {// dothis}解决方案
正常访问令牌在2小时内过期,令牌持续2个月。
通过这个获得扩展令牌。以完美的方式工作:
如何从offline_access弃用后扩展访问令牌的有效性
(您可以使用 Facebook的调试工具来检查您的访问令牌的有效性。)
Having problem with facebook api OAuth...
OAuthException: An active access token must be used to query information about the current user.loggain
the thing is that the first time it work perfect but after 3 tries it's giving me the error...
user can borrow a tool for free from the store and user can borrow up to 4 tools.. after every time user compeletes the steps i refresh the page and after 3-4 refresh i get the error
<?php header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"'); require 'php/facebook.php'; require 'php/faceconf.php'; $facebookoklog = ""; $facebookoklog1 = ""; $facebookok = ""; $facebook = new Facebook(array( 'appId' => $appID, 'secret' => $appSecret, )); $user = $facebook->getUser(); if(empty($user)){ global $facebookok; $facebookok = "getill"; } elseif($user){ try{ //get the facebook user profile data $user_profile = $facebook->api('/me'); $_SESSION['User']=$user_profile; }catch(FacebookApiException $e){ global $facebookoklog; global $facebookoklog1; $facebookoklog = "loggain"; $facebookoklog1 =$e; } } if($facebookoklog=="loggain" || $facebookok=="getill"){ //do this} else{//dothis}解决方案
The normal access token expires in 2 hours, and the extended token lasts for 2 months.
Go though this to get the extended token. Works with perfection:
How to extend access token validity since offline_access deprecation
(You can use Facebook's Debug Tool to check the validity of your access token.)
更多推荐
在3
发布评论