title: Cakephp before beforefilter
body: <p>In the beforeFilter, I am setting a variable for my default view based on the user that is logged in... This works great until the logout action is called.</p>
  
  <pre><code>class AppController extends Controller {
  var $components = array('Acl', 'Auth', 'Session', 'FcStudentMilestone', 'FcSection');    
  function beforeFilter(){
     $this-&gt;set('completed_data', $this-&gt;_completedData());
  }
  
  function _completedData(){
   $arr = array();
   $x = strval($this-&gt;Auth-&gt;user('id'));
   $compData = $this-&gt;FcStudentMilestone-&gt;find('all', 
      array('conditions' =&gt; array(
                          'FcStudentMilestone.user_id' =&gt; $x,
                          'FcStudentMilestone.completed' =&gt; '1')));
   foreach ($compData as $compDatum) {
   $compString = $this-&gt;FcSection-&gt;find('all', 
      array('conditions' =&gt; 
      array('FcSection.id' =&gt;   
      $compDatum['FcStudentMilestone']['fc_section_id'])));
   array_push($arr, $compString[0]['FcSection']['name']);  
   }
   return $arr;
  }
  </code></pre>
  
  <p>I think most of that code is irrelevant but it's there anyway. What is happening is, when the user logs out it is still trying to perform the query after the logout is happening but the Auth component has no user id.</p>
  
  <p>i have tried using the if($this->Auth->user()) or if($this->Auth->user('id')) but that is still returning true and proceeding to try and execute the query.</p>
  
  <p>here is the error I am getting : <code>Call to undefined method FcStudentMilestoneComponent::find()</code></p>
  
  <p>I do have the FcStudentMilestone component file in the components folder so i really think it has something to do with the lack of a user id but i could be way off.</p>
  
  <p>Also, have noticed that the error refers to the actual find statement, but I am calling the current user id in the line before, so why would it not flag that line instead of the line with the find statement?</p>