title: Laravel - Manual user login
body: <p>I am working on an application using Laravel and the Infusionsoft api (CRM application). Currently I am using the api to authenticate users with their infusionsoft credentials - this checks with infusionsoft and simply returns true if the credentials are correct - if a true is returned I want to manually log in the user I have in the database. The problem I am running into is that after I manually log in the user, it still fails to pass the built in auth filter.</p>
  
  <p>I have confirmed that the user is indeed being logged in using the Auth::check method, it just still won't pass the auth filter. Here is the code - </p>
  
  <pre><code>public function login()
      {
          $username = Input::get('username');
          $password = Input::get('password');
          $app = new iSDK();
          if ($app-&gt;cfgCon("connectionName")) {
              $uid = $app-&gt;authenticateUser("$username","$password");
              if (strpos($uid,'ERROR') !== false) {
                  echo $uid;
              }
              Auth::loginUsingId(3);
              if (Auth::check()) {
                  echo "Logged In";
              }
              return Redirect::intended('/');
          }
      }
  </code></pre>
  
  <p>So I am getting the "Logged In" echo'd, but on redirect, it kicks me back to the login page rather than the index page.</p>
  
  <p>I should also mention that login works fine when using the standard Auth::attempt method with the credentials stored in the laravel database.</p>
  
  <p>Can anyone help me figure this out?</p>