title: Connecting to a PHP website with Node.js and keep session
body: <p>I'm making a testbench with Test'em and Mocha (that run on node.js) in order to test a PHP website.</p>
  
  <p>What I want is to request some URL (e.g <a href="http://www.my-website/test.php" rel="nofollow">http://www.my-website/test.php</a>) and get the http status code as well as the content returned.</p>
  
  <p>I'm doing it with the node.js <strong>Request</strong> module.</p>
  
  <p><strong>The problem is:</strong></p>
  
  <blockquote>
    <p>I need to be authenticated to access this page, otherwise I'm
    redirected to the login page.</p>
  </blockquote>
  
  <p>So, does it exist a way to log in my application through Node.js and keep the session open to be able to chain tests on any pages I want?</p>
  
  <p>I was thinking on get the PHPSESSID on login request if it is possible. Do you thing it is a good direction ?</p>
  
  <p>Any help would be much appreciated.</p>
  
  <p>Thank you, have a nice day :)</p>
  
  <p>Michaël</p>