从URL中删除'code'参数

编程入门 行业动态 更新时间:2024-10-25 04:26:14
本文介绍了从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 = "yoursite/where-you-want-your-client";

这样:)

更多推荐

从URL中删除'code'参数

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

发布评论

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

>www.elefans.com

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