title: Call to a member function set_userdata() on a non-object, Codeigniter OAuth2
body: <p>I am trying to use <a href="https://github.com/philsturgeon/codeigniter-oauth2" rel="nofollow">philsturgeon's OATH2 spark for CodeIgniter</a> to authenticate a user using Facebook. I installed the Spark and tried the Usage Example tha he gives in the github.</p>
  
  <p>In the following code I only changed the id and secret.</p>
  
  <pre><code>&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
  
    class Auth extends CI_Controller
  {
      public function session($provider)
      {
          $this-&gt;load-&gt;helper('url_helper');
  
          $this-&gt;load-&gt;spark('oauth2-0.4.0');
  
          $provider = $this-&gt;oauth2-&gt;provider($provider, array(
              'id' =&gt; 'My_ID',
              'secret' =&gt; 'MY_Secret',
          ));
  
          if ( ! $this-&gt;input-&gt;get('code'))
          {
              // By sending no options it'll come back here
              $provider-&gt;authorize();
          }
          else
          {
              // Howzit?
              try
              {
                  $token = $provider-&gt;access($_GET['code']);
  
                  $user = $provider-&gt;get_user_info($token);
  
                  // Here you should use this information to A) look for a user B) help a new user sign up with existing data.
                  // If you store it all in a cookie and redirect to a registration page this is crazy-simple.
                  echo "&lt;pre&gt;Tokens: ";
                  var_dump($token);
  
                  echo "\n\nUser Info: ";
                  var_dump($user);
              }
  
              catch (OAuth2_Exception $e)
              {
                  show_error('That didnt work: '.$e);
              }
  
          }
      }
  }
  </code></pre>
  
  <p>But when I am trying to call the controller using</p>
  
  <pre><code>http://localhost/tddd27/index.php/auth/session/facebook
  </code></pre>
  
  <p>I get the following:</p>
  
  <pre><code>A PHP Error was encountered
  
  Severity: Notice
  
  Message: Undefined property: Auth::$session
  
  Filename: libraries/Provider.php
  
  Line Number: 117
  
  
  Fatal error: Call to a member function set_userdata() on a non-object in
  </code></pre>
  
  <p>C:\xampp\htdocs\tddd27\sparks\oauth2-0.4.0\libraries\Provider.php on line 117</p>
  
  <p>Is something wrong in the library or I am doing something wrong?</p>