First, let’s understand the session mechanism
Client (browser) cookie as key value, matching a data on the server side. Then the client will carry that cookie in the HTTP request every time, and the server will "take it for granted" that the data on the server is targeted at the client.
Some systems like to encode the session content and encrypt it in the cookie.
Then you can
1. You can share cookies and place the data where both nodejs and pornographic films (Sorry, which is PHP), such as redis. In the image, the default session of php is to write its own file, So, you need to rewrite it at the same time.
2. The two servers share a set of encryption and decryption methods, but it is not recommended.
The above is all about this article, I hope you like it.