Ask about the problem that the user logged out abnormally (directly closing the browser, etc.), resulting in the failure of the second login.

does not follow the process, unable to notify the backend to delete user_id, then the second login within the expiration time will return the login. What do I have to do in the front end, or what do I have to do in the background?

Mar.10,2021

  1. the above is a general practice;
  2. our product manager let the existing localStorage, expire for two hours; later, we didn't want to log on all the time, so we asked the backend to change it to 7 days.

General practice: login information is stored in cookie, and the browser will automatically bring it with it every time it requests. The backend verifies that the cookie has expired and redirects to the login page if it has expired.
this has nothing to do with whether the front end closes the browser or not.

Menu