Io disconnection reconnection

  node.js, question

How can a socket.io be realized when the user is disconnected from the internet, the user leaves the app, the network is unstable, etc. after reading a lot of articles on the internet, no perfect and exact solution can be found.

Please coordinate a user identification with the server side. Each time when the connection is truly established for the first time, an identification is generated and sent to the server. Then, the identification shall prevail. When the network is broken, the identification shall be retrieved and sent to the server. The server will restore the original site of the user according to the identification. If there is no server, then it can restore the site by itself.