title: "You cannot access this page directly" - Hybrid Auth
body: <p>I'm hosting my PHP Yii application on AWS Elastic Beanstalk and hence using the database to store sessions. I've successfully implemented facebook login using Hybridauth on a shared hosting environment. When I host on Elastic Beanstalk facebook login gives the error:</p>
  
  <pre><code>"You cannot access this page directly"
  </code></pre>
  
  <p>The URL ends up as:</p>
  
  <pre><code>http://mydomain.com/hybridauth/default/callback?hauth.start=Facebook&amp;hauth.time=1393106016
  </code></pre>
  
  <p>I've learnt from <a href="https://stackoverflow.com/questions/18655472/you-cannot-access-this-page-directly-hybridauth-social-login/18976083#comment33005629_18976083">here</a> that this is related to facebook calling back to the application but finding a different session. Endpoint.php then throws the error:</p>
  
  <pre><code>            # Init Hybrid_Auth
          try {
              // Check if Hybrid_Auth session already exist
              if ( ! isset( $_SESSION["HA::CONFIG"] ) ) { 
                  header( "HTTP/1.0 404 Not Found" );
                  die( "You cannot access this page directly." );
              }
  </code></pre>
  
  <p>How can I ensure facebook calls back to the same session and successfully signs in with hybridauth?</p>