The default cookie name corresponding to the session in express is a fixed value. If you deploy multiple express applications on a domain name but do not set the session cookie name, they will conflict with each other, so you should set it:
Obviously the session id is lost. It is speculated that the set cookie attribute in the http response header is not updated, resulting in the session id not being returned to the client. Grab a packet and see if the server also puts the session id in the header of the response when sending the redirect response. Then check to see if the client brings the session id when redirecting and requesting the server
If there are multiple servers, the session will be lost. Ask your server engineer to study the principles of cookies and sessions, and you will understand
Check whether it jumps under the same domain name
The default cookie name corresponding to the session in express is a fixed value. If you deploy multiple express applications on a domain name but do not set the session cookie name, they will conflict with each other, so you should set it:
The above example is based on express4.0
Obviously the session id is lost. It is speculated that the set cookie attribute in the http response header is not updated, resulting in the session id not being returned to the client. Grab a packet and see if the server also puts the session id in the header of the response when sending the redirect response. Then check to see if the client brings the session id when redirecting and requesting the server
If there are multiple servers, the session will be lost. Ask your server engineer
to study the principles of cookies and sessions, and you will understand
A session is essentially an ID, either in post/get or in cookies. You can open the debugging tool to see what is sent