title: Response with express and nodejs application
body: <p>I have an express server and a login page developed in HTML(with jquery). after login button is hit, jQuery fires a HTTP get request to express server and after user gets verified, user should be redirected to landing page with some data like name, gender, age etc(that is fetched from mongoDB on server itself). When I do <code>res.sendFile</code> or <code>res.redirect</code>, The parameters (name, age, gender) could not be sent on the view which is required there in response.</p>
  
  <p><strong>Jquery:</strong></p>
  
  <pre><code>$("#submit").click(function() {
    user = $("#email").val();
    pass = $("#password").val();
    $.post("https://localhost:443/login", {
      user: user,
      password: pass
    }, function(response) {
      if (response) {
        alert("login success" + response.userName);
      }
    });
  });
  </code></pre>
  
  <p><strong>HTML:</strong></p>
  
  <pre><code>&lt;form id="grad"&gt;
    &lt;h1 style="margin-top: -10px;    text-shadow: 1px 1px whitesmoke;"&gt;Login&lt;/h1&gt;
    &lt;h3 style="padding-bottom: 30px;font-size: 22px "&gt;Please enter email ID and password.&lt;/h3&gt;
    &lt;div class="group"&gt;
  
      &lt;input type="email" id="email" name="email"&gt;&lt;span class="highlight"&gt;&lt;/span&gt;&lt;span class="bar"&gt;&lt;/span&gt;
      &lt;label&gt;Email ID&lt;/label&gt;
    &lt;/div&gt;
    &lt;div class="group"&gt;
      &lt;input type="password" id="password" name="password"&gt;&lt;span class="highlight"&gt;&lt;/span&gt;&lt;span class="bar"&gt;&lt;/span&gt;
      &lt;label&gt;Password&lt;/label&gt;
    &lt;/div&gt;
  
    &lt;div class="group"&gt;
      &lt;input type="submit" id="submit" class="button buttonRed" value="Login" onclick="validateUser()" /&gt;
      &lt;input type="reset" class="button buttonRed" value="Reset" /&gt;
    &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>Express:</strong></p>
  
  <pre><code>app.post('/login', function (req, res) {
      // some logic to validate user and fetch details, which will be used on view.
      res.sendFile('landing**strong text**page.html', { root: "public" } );
  })
  </code></pre>