The app calls Webapi when there is no session to read

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.