title: Nodejs, express, passport going mobile
body: <p>Currently I have a website that used node.js, express.js as the backend API server and passport.js for authentication.  When the user login with their credentials the server will start a session and keep the user session in req.user or req.session.passport.user (Please correct me if I stated this incorrectly..)</p>
  
  <p>Later when you <code>GET /loggedin</code> it just <code>res.json(req.user)</code> and gives you the user information.  On the client we can simply <code>GET /loggedin</code> in every request to check the login status and user info.  </p>
  
  <p>This is working on a browser.  But when I am trying to do the same thing on mobile it appears that the device cannot establish a session with the server.  which mean <code>GET /loggedin</code> returns 401 unauthrorized.  </p>
  
  <p>So I was wondering if I am doing something wrong? </p>