Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
The cookie set allows you to retrieve the cookie value sent in an HTTP request.
Syntax Request. Cookies (Cookies) [(key) |. attribute]
Specifies the cookie for which the value is to be retrieved.
Optional. Used to retrieve the value of a subkeyword from the cookie Dictionary.
Specify information about the cookie. Its attribute parameters are as follows:
Read-only. Specifies whether the cookie contains a keyword.
You can access the subkeywords of the cookie Dictionary by including a key value. If no key is specified when you access the cookie dictionary, all keywords are returned as a single query string. For example, if MyCookie has two keywords: First and Second, and no keyword is specified when Request. Cookie is called, the following string is returned. First = firstkeyvalue & Second = secondkeyvalue
If the client browser sends two cookies with the same name, the Request. cookie returns a deeper path. For example, if there are two cookies with the same name, but one of the path attributes is/www/and the other is/www/home /, the client browser sends both cookies to the/www/home/directory. only the second Cookie is returned.
To determine whether a cookie is a cookie Dictionary (whether a cookie has a keyword), use the following script. False
If myCookie is a cookie dictionary, the previous value is TRUE. Otherwise, the value is FALSE.
You can traverse all Cookies in the cookie set or all keywords in Cookies cyclically. However, retrieving a cookie without a keyword does not produce any output. Use the HasKeys syntax to check whether the cookie has a keyword. This can be avoided. The example below demonstrates this.
The following example prints the value of myCookie on the Web page. This is the cookie value named myCookie:
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to firstname.lastname@example.org. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
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:
and provide relevant evidence. A staff member will contact you within 5 working days.