title: Laravel Socialite Remember Me
body: <p>I am using <a href="https://github.com/laravel/socialite" rel="nofollow noreferrer">Socialite</a> for user logins and I would like to set a <code>remember_token</code> to remember the user when they login through Socialite.</p>
  
  <p>Right now I have the following service to create or log the user in:</p>
  
  <pre><code>class SocialAccountService {
  
      public function createOrGetUser(ProviderUser $providerUser) {
  
          $account = SocialAccount::whereProvider('google')
              -&gt;whereProviderUserId($providerUser-&gt;getId())
              -&gt;first();
  
          if ($account) {
              return $account-&gt;user;
          } else {
              $account = new SocialAccount([
                  'provider_user_id' =&gt; $providerUser-&gt;getId(),
                  'provider' =&gt; 'google'
              ]);
  
              $user = User::whereEmail($providerUser-&gt;getEmail())-&gt;first();
              if (!$user) {
                  $user = User::create([
                      'email' =&gt; $providerUser-&gt;getEmail(),
                      'name' =&gt; $providerUser-&gt;getName()
                  ]);
              }
              $account-&gt;user()-&gt;associate($user);
              $account-&gt;save();
              return $user;
          }
      }
  }
  </code></pre>
  
  <p>It is called with the following controller:</p>
  
  <pre><code>class AuthController extends Controller {
  
      public function logout() {
          Auth::logout();
          return redirect('/');
      }
  
      public function redirectToGoogle() {
          return Socialite::driver('google')-&gt;redirect();
      }
  
      public function handleGoogleCallback(SocialAccountService $service) {
          $user = $service-&gt;createOrGetUser(Socialite::driver('google')-&gt;user());
          auth()-&gt;login($user);
          return redirect('/');
      }
  }
  </code></pre>
  
  <p>The issue is that when the user comes back they are not remembered and automatically logged in. How can I do this with Socialite?</p>