How to keep a session across domains?

  node.js, question

Express-session is used in the Express project. The front and back ends of the development phase are two different services, so the front end used the proxy method to request the server and found that this session could not be saved. What is the reason and how to solve it?

 secret: 'xxx',
 resave: true,
 saveUninitialized: false,
 maxAge: 1000 * 3600

I used angular scaffold at the front end. When I started the development, I started a service called localhost:3000, and then the address of the server was localhost:1994. Is this different domain?

Because the back end uses the session, and the key step of the session is to set a cookie on the browser, as if in a cross-domain case, the cookie is not set after logging in, and there is a cookie on the response.
Should I solve this problem from the front or from the server?

Session is an upgraded version of cookie, which uses cookie as id and then the data is stored on the server.
However, cross-domain is two different websites for cookie. Therefore, it is not a problem that can be solved by setting up one.

Different ports are different domains.
So you can set up a nginx or something to do forwarding to avoid cross-domain.
Can get a nginx, set 8080, then app points to 3000, api points to 1994.

Or use token instead of session to make api request.