title: Laravel issue with loginUsingId (Manual Authentication)
body: <p>I am trying to implement a <strong>single signon on multiple domains</strong>. The concept is pretty simple i.e to send unique user tokens and then verify these tokens to find the user and then log him in.</p>
  
  <p>Now after verifying the token and then grabbing the user, i do something like this</p>
  
  <pre><code>$loggedInUser = Auth::loginUsingId($user-&gt;id, true);
  </code></pre>
  
  <p>Now i have a custom middleware where it first checks for a logged in user, i.e</p>
  
  <pre><code>Auth::Check()
  </code></pre>
  
  <p>The above works fine for the first time. But on refresh Auth::check() is not validated. I have also tried using all different session drivers but still doesn't work.</p>
  
  <p>I used a similar code on laravel 5.2, and it did work. But on laravel 5.3 its not validating on persistent requests. </p>
  
  <p><strong>Edit: Let me show you my Code</strong>
  I have not modified AuthServiceProvider or any other guard. I do have the user model inside a directory but i have modified the path in auth.php.</p>
  
  <p>Here is the route that domain1 points to:</p>
  
  <p><a href="http://domain2.com/">http://domain2.com/</a>{{$role}}/{{$route}}/singlesignon/{{$token}}</p>
  
  <p>This is then picked up by verifySingleSignOn method inside the loginController which takes in the role, route that the user came in from other domain and the token. The user is then redirected to the same routes, but on domain2. Here i can successfully recieve the user id before manually logging in.</p>
  
  <pre><code>public function verifySingleSignOn($role, $route, $token)
      {
          // Fetch Single Signon
          $userRepository = new UserRepository();
          $user = $userRepository-&gt;checkForSingleSignOnToken($token, ['id']);
  
          // Check if Token Exists
          if (isset($user-&gt;id) &amp;&amp; is_int($user-&gt;id) &amp;&amp; $user-&gt;id != 0) {
  
              // Manually Logging a user (Here is successfully recieve the user id)
              $loggedInUser = Auth::loginUsingId($user-&gt;id);
  
              if (!$loggedInUser) {
                  // If User not logged in, then Throw exception
                  throw new Exception('Single SignOn: User Cannot be Signed In');
              }
              $redirectTo = $role . '/' . $route;
              return redirect($redirectTo);
          } else {
              return Auth::logout();
          }
      }
  </code></pre>
  
  <p>Then i have this GlobalAdminAuth middleware</p>
  
  <pre><code>   // Check if logged in
      if( Auth::Check() ){
          $user = Auth::User();
  
          // Check if user is active and is a globaladmin
          if( !$user-&gt;isGlobalAdmin() || !$user-&gt;isActive() ){
              return redirect()-&gt;guest('login');
          }
      }else{
          return redirect()-&gt;guest('login');
      }
  
      return $next($request);
  </code></pre>
  
  <p>Now the first time everything works fine and the user moves through the middleware successfully . but the second time the else statement is triggered.</p>
  
  <p><strong>Edit: Code for checkForSingleSignOnToken</strong></p>
  
  <pre><code>public function checkForSingleSignOnToken($token, $columns = array('*'))
  {
      return User::where('single_signon', $token)-&gt;first($columns);
  }
  </code></pre>