Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
210 views
in Technique[技术] by (71.8m points)

Removing the 'code' parameter from URL - Facebook connect PHP

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

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.

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

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

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";

Thats it :)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...