title: CakePHP: Call to a member function setFlash() on a non-object
body: <p>I get the following error when trying to logout of my CakePHP app:</p>
  
  <pre><code>Notice (8): Undefined property: UsersController::$Session [APP/controllers/users_controller.php, line 75]
  Fatal error: Call to a member function setFlash() on a non-object in /Users/cameron/Sites/cakeapp/app/controllers/users_controller.php on line 75
  </code></pre>
  
  <p>This is the code for lines 74, 75 and 76:</p>
  
  <pre><code>function logout() {
      $this-&gt;Session-&gt;setFlash('Good-Bye');
      $this-&gt;redirect($this-&gt;Auth-&gt;logout());
  }
  </code></pre>