electron actually runs a web page, and the communication methods are generally only http and websocket, which can be processed in the usual way of spa (single page application).
For example, Android will store the username, password, and cookie locally. When accessing the server, the cookie will be brought there, and the server will verify the cookie through the session. The session has expired. Tell the client that the session has expired through HTTP status code or custom status code. The APP reads the username and password from the local and sends HTTP to complete the login. If the login is successful, the server returns the new cookie to the client. , The client updates the locally stored cookie value after receiving it. To verify identity, you don’t have to use session or cookie, you can also use Token. Recommend a token called jwt, https://jwt.io/. I used it in an APP I made recently and thought it was good
electron actually runs a web page, and the communication methods are generally only http and websocket, which can be processed in the usual way of spa (single page application).
Recommend jwt to do it
For example, Android will store the username, password, and cookie locally.
When accessing the server, the cookie will be brought there, and the server will verify the cookie through the session.
The session has expired. Tell the client that the session has expired through HTTP status code or custom status code.
The APP reads the username and password from the local and sends HTTP to complete the login. If the login is successful, the server returns the new cookie to the client. ,
The client updates the locally stored cookie value after receiving it.
To verify identity, you don’t have to use session or cookie, you can also use Token.
Recommend a token called jwt, https://jwt.io/.
I used it in an APP I made recently and thought it was good