在3

编程入门 行业动态 更新时间:2024-10-26 02:36:46
本文介绍了在3-4次刷新之后,facebook acces令牌过期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

本文发布于:2023-11-04 10:18:02,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1557655.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!