Today in the testing of the company's app found such a problem, in the app call Webapi when the session is not read, on-line check a bit of a similar problem, decisive record down.
Demand:
1, the app in the change password when there is a process of obtaining verification code, we have this verification code information recorded in the session.
2, the app after obtaining the verification code needs a verification of the current verification code information and user information, the problem appears in the verification code validation process, at this time the session is not access to information.
Analyze the problem cause: The app lacks sessionid when requesting the API and causes the session not to know which session box to get from.
Solution:
1, in the use of the session, give SessionID a name, and then send to the client, each other to maintain the SessionID.
2. Modify the header of the client request. Set SessionID to cookie to make sure that two times SessionID is always on.
Get the CAPTCHA request for the first time:
The second time the validation request
The app calls Webapi when there is no session to read