title: Express Sessions and Requests
body: <p>I'm using express for my backend in a web application. I've tested it extensively, and when logging in from localhost:3000, the session is saved and all other requests have a user object attached to them. I protected all routes to need a logged in user, and when checking those routes from localhost:3000 as an origin they all work. I also have a route, /api/users/auth, that returns if a user is authenticated or not.</p>
  
  <p>My front end is an Angular 2 app. In development, it runs on localhost:8000. I can successfully post to the login route on my express server, localhost:3000/login, and it successfully logs in and returns the user. However, when I then try and access any other route or the /api/users/auth route, it says I'm not authorized. I also tried printing the request.user from the server when I make a call to a route, and it says it's undefined.</p>
  
  <p>My question is: how do I make sure that the session is saved when I login from localhost:8000, or how do send the user that's returned from logging in as part of the request? It seems to be automatic on the localhost:3000 side.</p>
  
  <p>Thanks in advance for any help.</p>