title: Redirect user after logout
body: <p>I'm trying to make a logout system, in c# logout work properly but in frontend when I click on the logout button, the isLogged variable is changed in the database in 0 of 1 (as it should be) but in the browser the user is not redirected to the login page and i get error " Requested JSON parse failed "</p>
  
  <p>i try to make ajax call to work properly, i search on this site solution but i can t fix this problem</p>
  
  <pre><code> var userAIDI = window.localStorage.getItem('userId');
      console.log(userAIDI)
      var usr = {
          userId:userAIDI
      }
  $.ajax({
          type: "POST",
          url: "https://localhost:44378/api/userLogOut",
          data: JSON.stringify(usr),
          contentType: "application/json",
          dataType: "json",
          success: function (data) {
              window.location.href = "pages/login.html";
  
  
              // Replace the div's content with the page method's return.
  
          },
          error: function (jqXHR, exception) {
              var msg = '';
              if (jqXHR.status === 0) {
                  msg = 'Not connect.\n Verify Network.';
              } else if (jqXHR.status == 404) {
                  msg = 'Requested page not found. [404]';
              } else if (jqXHR.status == 500) {
                  msg = 'Internal Server Error [500].';
              } else if (exception === 'parsererror') {
                  msg = 'Requested JSON parse failed.';
              } else if (exception === 'timeout') {
                  msg = 'Time out error.';
              } else if (exception === 'abort') {
                  msg = 'Ajax request aborted.';
              } else {
                  msg = 'Uncaught Error.\n' + jqXHR.responseText;
              }
              alert(msg);
          },
      });
  
  </code></pre>