Using Node.js to authorize a session as the client

EDIT: Re-wrote the question to be more general and focus on the core problem.

I've made a chrome extension that allows a user to play a mobile game in chrome. This is possible since the game is web-based.

Essentially what the extension does is:

  1. sends an ajax POST request with the user id
  2. the request returns a session id
  3. open a new tab to a particular url passing the session id as a param
  4. the page is then redirected to the game home page on successful authorization
    • otherwise, redirects to an error page

When I try to replicate this in Node.js:

  1. I use request to send the POST request with the user id
  2. the request returns a session id
  3. I send a GET request to a particular url passing the session id as a param
  4. the request returns with a status 500 response
    • It appears that the response body is the error page

I used a cookieJar (request.jar()) to handle the cookies/session, but I can't get it to work the same way the browser does it.

Any ideas?