从签名请求中删除 app_data
当我使用 GET 请求(例如“?app_data=1”)调用我的 fb-app 时,该变量位于签名的请求中。好的,到目前为止。但是,当我单击 Facebook 应用程序中的另一个链接时,app_data 仍在签名的请求中。我的应用程序对此做出反应,但我不再需要它。
如何删除签名请求中的 app_data?有人对这个问题有建议吗?
我使用 PHP 和 JS SDK。
$aSignedRequest = $_REQUEST['signed_request'];
if(isset($aSignedRequest))
{
$sSignedRequest = $aSignedRequest['signed_request'];
list($sEncodedSig, $sPayload) = explode('.', $sSignedRequest, 2);
// decode the data
$aData = json_decode(base64_decode(strtr($sPayload, '-_', '+/')), true);
$iContestId = $aData['app_data'];
}
When i call my fb-app with a GET request, like "?app_data=1", the variable is in the signed request. Ok, so far. But, when i click to another link in my fb-app, the app_data is still in the signed request. My application reactes on it, but i don't need it again.
How can i remove the app_data in the signed request? Has anyone a suggestion for this problem?
I use the PHP and JS SDK.
$aSignedRequest = $_REQUEST['signed_request'];
if(isset($aSignedRequest))
{
$sSignedRequest = $aSignedRequest['signed_request'];
list($sEncodedSig, $sPayload) = explode('.', $sSignedRequest, 2);
// decode the data
$aData = json_decode(base64_decode(strtr($sPayload, '-_', '+/')), true);
$iContestId = $aData['app_data'];
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是解决方案:
Here is the solution: