title: cannot get user_id with get_user()
body: <p>i am using the facebook php sdk in conjunction with codeigniter. the problem i have now is that i seem to be unable to get the user_id via get_user() it will always return 0. this is my code:</p>
  
  <pre><code>&lt;?php
  
  class Facebook_model extends CI_Model {
  
     public function __construct() {
          parent::__construct();
          $config = array(
              'appId' =&gt; '....',
              'secret' =&gt; '...',
              'fileUpload' =&gt; true
          );
      $this-&gt;load-&gt;library('facebook', $config);
      $user = $this-&gt;facebook-&gt;getUser();
  
      $profile = null;
  
      if ($user) {
          try {
              $profile = $this-&gt;facebook-&gt;api('/me?fields=id,name,link,email');
          } catch (FacebookApiException $e) {
              error_log($e);
              $user = null;
          }
      }
      $fb_data = array(
          'me' =&gt; $profile,
          'uid' =&gt; $user,
          'loginUrl' =&gt; $this-&gt;facebook-&gt;getLoginUrl(
                  array(
                      'scope' =&gt; 'email,user_birthday,publish_stream'// URL where you want to redirect your users after a successful login
                  )
          ),
          'logoutUrl' =&gt; $this-&gt;facebook-&gt;getLogoutUrl()
      );
      $this-&gt;session-&gt;set_userdata('fb_data', $fb_data);
  }
  
  }
  </code></pre>
  
  <p>i read somewhere it could be a problem with cookies and codeigniter but i can't figure ou how to solve this issue</p>