title: Laravel 5.3 AJAX login doesn't redirect
body: <p>I have similar issue like this <a href="https://stackoverflow.com/questions/39675978/laravel-5-3-ajax-login">one</a>.</p>
  
  <p>I'm trying to make AJAX login using Laravel 5.3 Auth.</p>
  
  <p>Here's what I got so far:</p>
  
  <pre><code>var login = function()
  {
  var data = {};
  
  data["email"] = $('#email').val();
  data["password"] = $('#password').val();
  
  if($('#remember').is(':checked'))
      data["remember"] = "on";
  
  $.ajax({
      type: "POST",
      url: '/login',
      data: JSON.stringify(data),
      // data: data,
      headers : { 'Content-Type': 'application/json' },
  
      success: function(data) {
          console.log(data);
          // window.location.href = "/dashboard";
      }
  });
  </code></pre>
  
  <p>};</p>
  
  <p>I'm sending CRSF token as <code>X-CSRF-TOKEN</code> header.</p>
  
  <p>The problem is that when I successfully login, I say on the same page,
  but in Network tab I can see that <code>/dashboard</code> page is loaded by I'm not
  redirected.</p>
  
  <p>In the same manner, when I pass wrong credentials, I stay on the same page,
  but I can see that <code>/login</code> page is loaded in the separate call with an error message that should be actually displayed.</p>
  
  <p>Also, I've tried without <code>headers : { 'Content-Type': 'application/json' },</code>
  and sending data as: <code>data = data,</code> but I get the same thing.</p>
  
  <p>Why the browser doesn't redirect to that page since it is loading it in the "background"?</p>
  
  <p>Edit: I'm getting correct page as request response as well, I can see it 
  in console (<code>console.log(data)</code>;).</p>