title: PHP: how to retrieve profile data from Facebook
body: <p>I've been going through FB docs but I think I am totally lost now. My task is quite simple: I need to have an "import" link, user clicks it and receives FB popup where he authorizes the site, user is redirected back to my site, I access user's FB profile and retrieve some data. Also: I need to access and retrieve profile in PHP.</p>
  
  <p>The first part goes well. I created mysite.com?page=import link which opens in popup and then redirects to <a href="https://graph.facebook.com/oauth/authorize" rel="nofollow noreferrer">https://graph.facebook.com/oauth/authorize</a>?...
  User then allows access and the popup is redirected back to mysite.com?...#access_token=...&amp;expires_in=4031
  Then I am going to close the popup and instead refresh the parent window that opened this popup by redirecting it to something like this mysite.com?page=register&amp;access_token=...&amp;expires_in=4031
  Then I was going to use their PHP SDK hoping that it can take this access token and allow me to get user's data. However I have no luck so far. I've tried lots of things and went through facebook.php but can't see a solution. Please let me know how to do this: authorize user in a popup and then gather the profile data in php.</p>