title: Laravel 5.2 Auth::login not persisting logged user
body: <p>I have an authentication system which has also social login using Socialite.</p>
  
  <p>
  The problem is when I use <code>Auth::login()</code> to log in the user when successfully authenticated from social media, the session doesn't persist after redirecting.</p>
  
  <p>Though I am using the <code>web</code> middleware</p>
  
  <p>here is my code in <code>routes.php</code></p>
  
  <pre class="lang-php prettyprint-override"><code>Route::group(['namespace' =&gt; 'Frontend', 'middleware' =&gt; 'web'], function () {
      Route::get('/', 'PagesController@index');
      Route::get('login/{provider?}', 'AuthController@getLogin');
      Route::post('login', 'AuthController@postLogin');
      Route::get('login/callback/google', 'AuthController@getGoogleCallback');
      Route::get('login/callback/facebook', 'AuthController@getFacebookCallback');    
  });
  </code></pre>
  
  <p>and when the user is successfully authenticated in Facebook for example, I use this in my controller</p>
  
  <pre class="lang-php prettyprint-override"><code>Auth::login($user);
  return redirect()-&gt;to('/');
  </code></pre>
  
  <p>but after redirecting it gives me <code>null</code></p>
  
  <p>I also moved my <code>User.php</code> to <code>app/Models/User.php</code> and made all the necessary changes in <code>config/auth.php</code>.</p>