title: Any Facebook PHP SDK v4.06 working Canvas App Example? Cant Get a valid session
body: <pre><code>&lt;?php
  // include required files form Facebook SDK
  require_once( 'Facebook/FacebookSession.php' );
  require_once( 'Facebook/FacebookCanvasLoginHelper.php' );
  require_once( 'Facebook/FacebookRedirectLoginHelper.php' );
  require_once( 'Facebook/FacebookRequest.php' );
  require_once( 'Facebook/FacebookResponse.php' );
  require_once( 'Facebook/FacebookSDKException.php' );
  require_once( 'Facebook/FacebookRequestException.php' );
  require_once( 'Facebook/FacebookPermissionException.php' );
  require_once( 'Facebook/FacebookOtherException.php' );
  require_once( 'Facebook/FacebookAuthorizationException.php' );
  require_once( 'Facebook/GraphObject.php' );
  require_once( 'Facebook/GraphSessionInfo.php' );
  require_once( 'Facebook/GraphUser.php' );
  require_once( 'Facebook/GraphLocation.php' );
  include ("fns.php");
  
  use Facebook\FacebookSession;
  use Facebook\FacebookRedirectLoginHelper;
  use Facebook\FacebookCanvasLoginHelper;
  use Facebook\FacebookRequest;
  use Facebook\FacebookResponse;
  use Facebook\FacebookSDKException;
  use Facebook\FacebookRequestException;
  use Facebook\FacebookOtherException;
  use Facebook\FacebookAuthorizationException;
  use Facebook\GraphObject;
  use Facebook\GraphSessionInfo;
  use Facebook\GraphUser;
  use Facebook\GraphLocation;
  // start session
  session_start();
  
  // init app with app id and secret
  FacebookSession::setDefaultApplication( 'XXXXXXXXXXx','yyyyyyyyyyyyyyyy' );
  
  $helper = new FacebookCanvasLoginHelper();
  
  try {
  
            $session = $helper-&gt;getSession();
  
  
  
  } catch (Exception $ex) {
   // echo $ex-&gt;getMessage();
  
  }
  
  if($session)
  {
      $request = new FacebookRequest( $session, 'GET', '/me' );
      try{
  
           $response = $request-&gt;execute();
           $graphObject = $response-&gt;getGraphObject();
           //echo  print_r( $graphObject, 1 );
           $fid = $graphObject-&gt;getProperty('id'); echo $fid;
           $femail = $graphObject-&gt;getProperty('email'); echo $femail;
           $ffirst_name = $graphObject-&gt;getProperty('first_name'); echo $ffirst_name;
         } catch (Exception $ex) {
         // echo $ex-&gt;getMessage();
  
         }
  }
  </code></pre>
  
  <p>?></p>
  
  <p>First off, I am not an expert PHP coder, so I do not understand a lot of things, but I do know how to use a working example. I made a Canvas App that was working fine. Then I installed ssl and it no longer works. The code itself is a mess from my efforts to fix the problem.</p>
  
  <p>Can I just get a working example that echos user public data using FacebookCanvasLoginHelper with the latest 4.06 PHP SDK? I can take it up from there if I can see that.</p>
  
  <p>Since V4.0,  getsession() no longer seems to work. In V4.06 its supposed to have been fixed, but I still cant get it to work.</p>
  
  <p>Thanks in advance</p>
  
  <h2><strong>Edit</strong></h2>
  
  <p>I have added the relevant code. After debugging, i find that it appears $session is not valid or something because code execution never gets past "$request = new FacebookRequest( $session, 'GET', '/me' );". I cant seem to get anything echoed out after that. please any help is much appreciated.</p>