Syntax (post) of the header line of the HTTP request of cookie)

Source: Internet
Author: User

1. When a URL is requested from an HTTP server, the browser compares the URL with all Cookies stored on the client host, the line that matches the cookie that contains the name/value pair will be included in the HTTP request header.

The format of the request header line is:

COOKIE: name1 = value1; name2 = value2; ......; Namen = valuen

2. When the HTTP server encounters this row in the Request Header, it extracts the child string of the name/value pair from this row and places the string in the environment variable http_cookie. When CGI is executed, you can obtain data from the environment variable http_cookie in the form of name/value pairs.

For example:

Send the following requests to the server:

GET/cgi/Hello. cgi? Name = zhangsan & quest = Peace HTTP/1.0

Cooike: age = 25

<Blank line>

Then, the server puts the string "name = zhangsan & quest = Peace" into the environment variable QUERY_STRING and puts the string "age = 25" into the environment variable http_cookie to provide the CGI script to be called.

 

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.