For the first time to do the API development of the app, the first question encountered was: where is my sessionid?
The implementation of a function is: SMS verification function, the general flowchart is as follows:
The problem arises when the client does not bring the SessionID through the header when submitting the verification. At this point, the server does not know which session to take the value from to judge. So the core point of the problem is where is this sessionid? When I used to do PC-side, I never cared about this problem, because the browser helped us to finish it.
Solution One:
First of all, this error is not due to the server error, the server can still be like normal PC development time encoding, of course, here you can also use the session, give SessionID a name, and then send to the client, Each of you maintains this sessionid each other. This is a solution.
Solution Two:
Modify the header of the client request get or POST request. Set the SessionID to a cookie. One of the issues to be aware of here is to ensure that the SessionID is unique when set up, otherwise the server will still not be able to locate the session member.
Note: In my project, only the Android side has this problem, iOS does not appear this SessionID loss situation, iOS Use the framework is afnetworking. I think there must be something inside the framework.
API Development First: App Server API development for session