title: Facebook login fails on website with SSL
body: <p>We're building a web app in PHP. We've set up SSL certificate and right after that the FB login stopped working. When the script tries to get user ID, exception is thrown</p>
  
  <blockquote>
    <p>An active access token must be used to query information about the current user.</p>
  </blockquote>
  
  <p>I'm 100% positive the SSL is the problem because it works fine on my localhost and it also worked on the production before setting up the SSL.</p>
  
  <p>We're using Facebook PHP SDK. Here is the first part (getting login url)</p>
  
  <pre><code>$facebook = new Facebook([
      "appId" =&gt; "APP_ID",
      "secret" =&gt; "SECRET"
  ]);
  
  $permissions = ["email", "user_birthday", "publish_stream", "offline_access"];
  $loginURL = $facebook-&gt;getLoginUrl([
      "scope" =&gt; join(",", $permissions),
      "redirect_uri" =&gt; "REDIRECT_URI"
  ]);
  // redirect to $loginURL
  </code></pre>
  
  <p>And here's the callback</p>
  
  <pre><code>$facebook = new Facebook([
      "appId" =&gt; "APP_ID",
      "secret" =&gt; "SECRET"
  ]);
  
  $userID = $facebook-&gt;getUser();
  $token  = $_GET['code'];
  
  if(isset($userID) &amp;&amp; isset($token)) {
      // ... some cool stuff
  } else {
      // error, something happened
  }
  </code></pre>
  
  <p>Thanx for help</p>
  
  <p>EDIT: I was getting the error because I was trying to get details about user by the <code>$userID</code>. Problem was, the <code>$userID</code> is always 0 so no wonder I got error. Somehow I can't get user's ID on the website with SSL...</p>