Some notes on Get and post,session and cookies

Source: Internet
Author: User

The difference between 1.GET and post

  A. In terms of literal meaning and HTTP specifications, get is used to obtain resource information and post is used to update resource information.

B. The data entity for the Get submit request is placed behind the URL, separated by the?, parameters with & connection, for a chestnut:/index.html?name=wang&login=1

C. The data length of a get commit is limited because the URL length is limited and the specific length limit is dependent on the browser. and post does not.

D. The data submitted by get is unsafe because the parameters are exposed on the URL.

The difference between 2.408 Request timeout and 504 Gateway timeout

  408 is to say that the request timed out, that is, after the connection is established, the client does not send a request to the client to the server. This is essentially due to client or network congestion. 504 is the network timeout, it is said that the proxy server forward the client request to the application server after the agreed time not received the application server response. This is essentially due to slow response on the service side, and possibly network problems.

  3.Cookie and session Differences and links

Both the cookie and the session are designed to preserve the interaction state between the client and the server, with different mechanisms and advantages and disadvantages.

The first big difference is that the cookie is stored on the client and the session is stored on the server.

A cookie is a client requesting the server to return some information to the client in the form of a key-value pair, stored in the browser, and added to these cookie values when interacting. Cookies make it easy to do some caching. The disadvantage of a cookie is that there is a limit to the size and quantity of the cookie, which may be disabled, deleted, tampered with, or not secure, and if the cookie is large, it should be brought with each request, which affects the efficiency of the transmission.

S Ession is implemented based on cookies, except that the session itself is present on the server, but the data is not transmitted each time it is transmitted, but only the unique ID (usually Jsessionid) representing a client is written in the client's cookie. This allows the ID to be transferred each time. The advantage of the session is that the amount of data transmitted is small and relatively safe.

But the session also has shortcomings, that is, if the session does not do special processing is easy to fail, expired, lost or too many sessions lead to server memory overflow, and to achieve a stable and usable security of the distributed session framework is also a certain degree of complexity. In the actual use of the combination of cookies and the advantages and disadvantages of the session for different problems to design a solution.

Some notes on Get and post,session and cookies

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.