Several questions about the interaction between the server and the mobile end

Source: Internet
Author: User
I am working on PHP. recently I have been working on interaction with ios and Android, so there are several problems. 1. how does one record the information of the currently logged-on user after logging on to the mobile terminal? does the web end use session, and what does the mobile end use? 2: The mobile client still uses get and post to upload data, but it saves... I am using PHP. Recently, my work involves interaction with ios and Android, so there are several problems.

1. how does one record the information of the currently logged-on user after logging on to the mobile terminal? does the web end use session, and what does the mobile end use?

2: the mobile terminal still uses get and post to upload data, but if you save the FILE, it seems that the $ _ FILE array cannot be used online, only binary files can be converted from POST information to files. Is there any ready-made code for reference?

I used to write only json interfaces before. I hope I have some background development experience on mobile terminals. thank you!

Reply content:

I am working on PHP. recently I have been working on interaction with ios and Android, so there are several problems.

1. how does one record the information of the currently logged-on user after logging on to the mobile terminal? does the web end use session, and what does the mobile end use?

2: the mobile terminal still uses get and post to upload data, but if you save the FILE, it seems that the $ _ FILE array cannot be used online, only binary files can be converted from POST information to files. Is there any ready-made code for reference?

I used to write only json interfaces before. I hope I have some background development experience on mobile terminals. thank you!

  1. You can maintain a token on the web end. when the client logs on, it saves the token returned by the server, and all subsequent requests carry the token. the client is logged on by default before the token is returned and the server does not return the expiration information.

  2. If you use some network connection frameworks, you do not need to convert them into word-based throttling. you only need to input the file name and path.

Mobile interfaces are the same as web interfaces. A session is also used to record the logon status. To save a file, use $ file = $ _ FILES ['upfile']. I do not remember to convert the file.

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.