ios-php issues with writing interface session data

Source: Internet
Author: User
Keywords Php android ios
The scenario is: use PHP to write Android and iOS background interface (e-commerce platform app

What do you do with cookies and sessions on the original web?
Seemingly interface can also use the session, but =. = I asked us about iOS he said he didn't use cookies or anything. Orz
Don't know if there's a better way to do it in the app
Ask the app to post the user data when it requests the interface? Is there anything wrong with security?

Reply content:

The scenario is: use PHP to write Android and iOS background interface (e-commerce platform app

What do you do with cookies and sessions on the original web?
Seemingly interface can also use the session, but =. = I asked us about iOS he said he didn't use cookies or anything. Orz
Don't know if there's a better way to do it in the app
Ask the app to post the user data when it requests the interface? Is there anything wrong with security?

Stay logged in with session:
After the app is logged in (directly verifying the password or third-party login), the server generates a random token string for that user, which is saved in a User data table and in the session. Then in the need to login permissions, let the app every HTTP request header with this token, and then the server to take the token in session and the check, the equivalent is the login status.

Your client may be using oauth2.0.

Encrypted user session data is passed through post, if the condition allows to walk HTTPS

http://www.toozy.cn/api-authorization/

The implementation is the same as the browser cookie mechanism, for example, the client locally to save the server Set-cookie, and then each commit with the previous set of cookies, equivalent to the Android developer manually implement the browser cookie mechanism. session_id is stored in a cookie in the same vein.

Signature encrypted transport: Public key transfer, private key encryption

  • 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.