title: Express authentication handling does not function
body: <p>I am building a demo authentication system using express in combination with sqlite 3. Authentication functions the way it should, but the client does not react to any of the responses such as:</p>
  
  <pre><code>res.send('welcome to website');
  </code></pre>
  
  <p>or</p>
  
  <pre><code>res.redirect(login.html);
  </code></pre>
  
  <p>or</p>
  
  <pre><code>res.redirect('http://google.com');
  </code></pre>
  
  <p>How can I properly handle a login after it is approved?</p>
  
  <p>Server side:</p>
  
  <pre><code>app.get('/login/username/:userN/password/:passW', function (req, res) {  
    var username = req.params.userN,
         password = req.params.passW;
  
         console.log('initiating login');
  
     db.get('SELECT * FROM users WHERE username=?', [username], (err, row) =&gt; {
       if (row == undefined){
         console.log('login fail (user doesnt exist)')
       }
       else if (row.password == password) {
         res.redirect('http://google.com');
         console.log('user: ' +  username + ' logged in');
       }
       else {
         console.log('login fail (wrong password)');
       }
     })
   });
  </code></pre>
  
  <p>Clientside:</p>
  
  <pre><code>    function get(url) {
          xmlhttp = new XMLHttpRequest();
          xmlhttp.open("GET", "http://localhost:3000/" + url, true);
          xmlhttp.send();
      };
  
      $('#login').click(function server() {
          var username = document.getElementById('user').value;
          var password = document.getElementById('pass').value;
          var url = 'login/username/' + username + '/password/' + password;
          get(url);
  
      });
  </code></pre>