Talk:Logging In And Connecting
From Facebook Developer Wiki
So whats the problem with PHP login?
- I spoke with the engineer who worked on the Connect login code, and he mentioned a couple issues: the redirect to "thisPage.php?doFacebookLogin" is wrong. Facebook Connect requires Javascript, it doesn’t work otherwise. Your code uses $fb->user when you should be using $fb->get_loggedin_user() (for security reasons). -- Pete (563683308 11:28, 25 March 2009 (PDT))
I would be really grateful if you could point out where any of this is documented.
Your claim that login requires JavaScript appears to be wrong since, as far as I can tell, I have managed to get it working entirely with PHP. I am very confused about this.
- But don't you find you're making the server do work that the client otherwise would do?
Line 285 of facebook.php shows that $fb->get_loggedin_user() returns $this->user.
- I'll ask the engineer to elaborate more.
So here is what I have in mind:
And to do the login in the first place:
Just how badly wrong is this?
[edit] window.location for FB connect
Hi I have the Connect script installed for my template and when a user clicks on it it is opening a new browser window. I tried to change the window.location to point to the referring page but it still wants to open the sites homepage in a new window. How do I make it so that clicking on the connect button leaves the user on the same page?
- Can you elaborate on the repro steps here, please? It sounds like this is happening:
- User comes to your site, clicks the Connect button.
- The Connect with Facebook dialog pops up in a new window, letting the user either log in to Facebook and connect to your site, or simply connect to your site with his or her Facebook account.
- The Connect with Facebook window doesn't close, and the user is redirected back to your site in the same window (the popup), and not redirected to your site in the original window.
- You want the connected user to get redirected to your site in a connected state in the original window.
- Is this what you're experiencing? Also, what do you mean by template? Thanks, Pete -- 563683308 16:58, 12 October 2009 (PDT)
