The HTTP protocol limits the URI length, POST data length, and COOKIE length.

Source: Internet
Author: User
The HTTP protocol does not limit the URL length. this is described in RFC. HTTP does not limit the URI length, the server must be able to process any URIs that can be accepted by the services they provide. URL length limit
The HTTP protocol does not limit the URL length. this is described in RFC. HTTP does not limit the URI length, the server must be able to process any URIs that can be accepted by the services they provide and can process an infinitely long URI. if the server cannot process too long URIs, it should return a 414 status code.
Although the Http protocol stipulates Web serverAnd BrowserEach URI has its own length limit.
Server restrictions: the most frequently accessed servers are Nginx and Tomcat. for url length restrictions, they are restricted by controlling the length of the http request header, the nginx configuration parameter is large_client_header_buffers, and the tomcat request configuration parameter is maxHttpHeaderSize, which can be set by yourself.
Browser restrictions: each browser also limits the url length. below are the url length restrictions for several common browsers: (unit: character)
  • IE: 2803
  • Firefox: 1, 65536
  • Chrome: 1, 8182
  • Safari: 80000
  • Opera: 1, 190000

For get requests, there is no limit on the number of request parameters within the url length limit.
2. length limit of Post data
The length limit of Post data is similar to the url length limit. it is also not specified in the Http protocol. the length limit can be achieved by configuring the maximum length of http request headers on the server side.
3. Cookie length limit
The Cookie length limit is summarized in the following aspects.
(1) the maximum number of cookies allowed by the browser in each domain is not tested by yourself. The information found on the internet is probably like this.
  • IE: 20, and then 50
  • Firefox: 50
  • Opera: 30
  • Chrome: 180
  • Safari: unlimited

When the number of cookies exceeds the limit, the browser's behavior: IE and Opera will use the LRU algorithm to clear old infrequently used cookies, and Firefox will randomly kick out some cookies. Of course, no matter what the policy or try not to make the number of cookies exceed the permitted range of the browser.
(2) maximum length of each Cookie allowed by the browser
  • Firefox and Safari: 4079 bytes
  • Opera: 4096 bytes
  • IE: 4095 bytes

(3) restrictions on the length of Http request headers on servers. The Cookie is attached to the http request header and sent to the server. Therefore, it is also affected by the length of the server request header.

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.