📅  最后修改于: 2023-12-03 15:29:29.447000             🧑  作者: Mango
ASP Request.Cookies 集合包含了客户端发送到服务器的所有Cookie。通过这个集合,可以在服务器端读取、设置、删除、以及枚举所有的Cookie。
Request.Cookies(cookieName)
cookieName
:要读取的Cookie的名称。它是一个字符串类型的必需参数。
返回值是一个Cookie对象,包含了请求中的该Cookie的名称、值、过期日期、路径、域以及其它属性。
Dim myCookie
Set myCookie = Request.Cookies("myCookieName")
If Not myCookie Is Nothing Then
Response.Write myCookie("myCookieValue")
Else
Response.Write "Cookie not found!"
End If
Dim myCookie
Set myCookie = Response.Cookies("myCookieName")
myCookie("myCookieValue") = "MyValue"
myCookie.Expires = Date + 30
myCookie.Path = "/"
myCookie.Domain = ".example.com"
Dim myCookie
Set myCookie = Response.Cookies("myCookieName")
myCookie.Expires = Date - 1
Dim cookieName
For Each cookieName In Request.Cookies
Response.Write cookieName & " : " & Request.Cookies(cookieName) & "<br>"
Next