Micro letter applet user login status kept thinking

Applet landing state remains
    1. Definitions token field in the micro channel applet global variable
    2. The first time you load an applet, get sessionId server, and sessionId deposited in the client's token
            PS: When you load an applet best to pass a user's unique identifier Id to the server in order to avoid user errors refresh applet lead to the loss of landing state (can not)
    3. the acquired token as wx.request request header (header) parameter to the service side
            PS: wx.request request header addition clienttype parameters, set a value proweixin; needs to check whether the server authentication code is determined according to clienttype (if no verification code, can not do)
    4. The verification server after user login time, taken for the token key, taking the user to the information value stored in the cache server, and set the timeout of the information (recommended into Redis, comes out mechanism)
    5. After the client user login, before the server cache token information timeout, the client sends to the server with every request from the user is deemed to have landed without landing again (before adding interceptors request, verify whether the token timeout )

Guess you like

Origin www.cnblogs.com/wslio/p/11703758.html