The trouble of WeChat Mini Programs's login status maintenance

this question puzzled me for a long time. Mini Program takes too long to start checking login status (using wx.checkSession) and loads a lot of page data, which is very slow to display.

I now set the custom login state 3rd_session to be valid for 3 days on the backend, and cache it locally. Each time I open the user center page, read the local 3rd_session to determine whether I have logged in. When the request request is involved, check whether the 3rd_session expires at the backend. If it expires, call the frontend to log in again. I wonder if this logic is correct?

there are some other troubles:

  • what if the local cache is deleted or corrupted? (there is no official explanation on the validity of local cache, only that it will be deleted after a certain period of time. I don"t know how long it will take.)
  • what if the user table data has been maliciously modified to affect normal order payment?
  • if the restart of the backend failure is due to the failure of the validity period of the 3rd_session setting, do you want to reset it?

about: Mini Program takes too long to start checking login status (using wx.checkSession) and loads a lot of page data, which will be very slow to display.

  • can have a page without any additional resources, which is used to do wx.checkSession alone. Verify by jumping to the corresponding page (for example: index.html )
.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-7b64b9-1ec29.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-7b64b9-1ec29.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?