ASP operation Method of cookies _ Application skills

Source: Internet
Author: User
The method is as follows:
Response.Cookies (Cookiesname) [(Key) |. Attribute]=value
The explanation is as follows: Cookiesname is the name of the cookie you want, for example: test
Parameter key: Optional parameter, of course, not specified also can be. :)
Key is used to specify the name of the cookie for the dictionary cookie. My understanding seems to resemble an array.
Parameter attribute optional, specify the cookie itself related information, such as specifying a specific URL, path, expiration, and so on.
The optional values are: domain can only read cookies for a specific domain name
Expiration of Expires Cookies
Whether HasKeys contains child cookies
Path can only read cookies on the specified path
SECURE Specifies whether the cookie is encrypted
For example, to specify a cookie named jb51 on this web site, the following methods are:
Copy Code code as follows:

Response.Cookies ("jb51"). Domain = "www.xxx.com" ' Specifies www.xxx.com access
Response.Cookies ("jb51"). Path = "E-blog" ' Specifies E-blog Directory access
Response.Cookies ("jb51"). Expires= DateAdd ("D", 2,date) ' specified expires in two days
Response.Cookies ("jb51") ("name") = "Test"
Response.Cookies ("jb51") ("type") = "hehe"
[HTML]
The above two sentences is to make a dictionary-style cookies.
The usage of HasKeys is quite simple, request. Cookies (cookies). HasKeys can be, for example, to determine whether a cookie is a dictionary, you can write
[Code]
<%
If request.cookies ("jb51"). HasKeys Then
Response.Write "This is a dictionary of cookies."
Else
Response.Write "It's not a dictionary cookie."
End If
%>

More Information reference: http://www.jb51.net/article/22640.htm

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.