title: Cakephp: $session->flash(); gives error to me
body: <p>I am quite new at cakephp despite using it several years ago in the older version of cakephp for school. Now it requires us to use $session->flash(); to display our error messages. I placed it in my view/layouts/default.ctp and this is what i got</p>
  
  <pre><code>Call to a member function flash() on a non-object in
  C:\xampp\htdocs\blog\app\View\Layouts\default.ctp on line 9
  </code></pre>
  
  <p>here are my codes:</p>
  
  <pre><code>class PostsController extends AppController {
      var $name = 'Posts';
      var $helpers = array('Html', 'Form', 'Session');
  
  public function delete($id = null) {
      $this-&gt;Post-&gt;id = $id;
          if (!$id) {
              $this-&gt;Session-&gt;setFlash(_('Post does not exist!', true));
              $this-&gt;Session-&gt;redirect(array('action'=&gt;'index'));
          }
          if ($this-&gt;Post-&gt;delete($id)) {
              $this-&gt;Session-&gt;setFlash(__('Post deleted', true));
              $this-&gt;redirect(array('action' =&gt; 'index'));
          }
      }
  }
  </code></pre>