从URL中删除'code'参数 - Facebook连接PHP [英] Removing the 'code' parameter from URL - Facebook connect PHP

查看:138
本文介绍了从URL中删除'code'参数 - Facebook连接PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在登录之后删除我网站的URL中的?code = [...] 参数?我正在使用Facebook PHP SDK。

How can I remove the ?code=[...] parameter that is in my website's URL after logging in ? I am using the Facebook PHP SDK.

推荐答案

在oauth 2.0登录流程中需要代码参数。它是登录协议的一部分。

The code parameter is required in the oauth 2.0 log in flow. It is part of the login protocol.

似乎您已经成功地使用该协议,因此我不需要告诉你。

It appears that you already successfully employ that protocol, so I don't need to tell you about that.

但是要回答你的问题。在该参数的url已被客户端调用后,您执行了登录(设置会话变量,cookie等等,只是发出一个标题重定向。

However to answer your question. After the url with the parameter has been called by the client and you performed the log in (set session variable, cookie etc., just issue a header redirect.

您已标记您的问题为 php ,所以这将像

You flagged your question as php so this would be something like

header("Location: /where-you-want-your-client');

如果你有登录流程在javascript中实现,您可以执行以下操作:

If you have the login flow implemented in javascript you can do that with:

window.location.href = "http://yoursite.com/where-you-want-your-client";

这样:)

这篇关于从URL中删除'code'参数 - Facebook连接PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆