title: Cakephp2.5.5: Auth not going to login user
body: <p>I have created app where I used the AuthComponent for user authentication.</p>
  
  <p>It is working fine.</p>
  
  <p>but I have created one function which login user with user data as follows.</p>
  
  <pre><code>protected function __login_user($conditions) {
      $this-&gt;User-&gt;recursive = -1;
      $userData = $this-&gt;User-&gt;find('first', array('condtions' =&gt; $conditions));
      unset($userData['User']['password']);
      if( !empty( $userData ) ) {
              $this-&gt;Auth-&gt;login($userData['User']);
              return true;
      } else {
          return false;
      }
  }
  </code></pre>
  
  <p>This function works fine when I login with ajax.</p>
  
  <p>But if it is http request with post/get it work as::</p>
  
  <p>It redirect me to the login redirect link, show the session for auth too just one time.</p>
  
  <p>When I refresh the page the session get loss and logout.</p>
  
  <p>Does anyone know why this happening?</p>