title: Using session component in custom component
body: <p>I'm trying to use Session component in custom component (CakePHP 2.3) but when I call Session component functions I get: Fatal error: Call to a member function read() on a non-object in ...\app\Controller\Component\CartComponent.php on line 7</p>
  
  <p>My CartComponent looks like that:</p>
  
  <pre><code>&lt;?php
  App::uses('Component', 'Controller');
  class CartComponent extends Component {
      public $components = array('Session');
  
      function hasItems() {
          $cart = $this-&gt;Session-&gt;read('Cart');
          return $cart != null &amp;&amp; count($cart) &gt; 0;
      }
  
  }
  ?&gt;
  </code></pre>
  
  <p>And I use it in controller:</p>
  
  <pre><code>&lt;?php
  class OrdersController extends AppController {
      public $name = 'Orders';
      public $components = array('Cart', 'Email');
  
      function beforeFilter() {
          parent::beforeFilter();
          if ($this-&gt;Cart-&gt;hasItems()) {
              $this-&gt;Auth-&gt;allow('add_item', 'remove_item', 'cart');
          } else {
              $this-&gt;Auth-&gt;allow('add_item', 'remove_item', 'cart', 'make');
          }
      }
  }
  ?&gt;
  </code></pre>