Cookie|cookie writecookie.asp
<%@ Language=vbscript
%>
<%Response.Buffer=true%>
<HTML>
<HEAD>
<meta name= "generator" content= "Microsoft Visual Studio 6.0" >
<TITLE> Write cookies For example </TITLE>
</HEAD>
<BODY>
<%
Response.Write "Write Cookie:<br>"
Response.Cookies ("Cookie1") ("key1") = "KeyValue1"
Response.Cookies ("Cookie1") ("key1") = "KeyValue2"
Response.Cookies ("Cookie1"). Expires = "July 31, 1999"
Response.Cookies ("Cookie2") ("key2") = "KeyValue1"
Response.Cookies ("Cookie2") ("key2") = "KeyValue2"
Response.Cookies ("Cookie2"). Expires = "July 31, 1999"
' Response.Cookies ("Cookie2"). Path = "/testasp/"
' This should be noted in the use of
' is the file specified in that directory to be able to read the contents of this cookie.
' In this example. Only files in the testasp directory can be read
' Cookie2 's content.
%>
</BODY>
</HTML>
-------------------------------------------------------
Readwrite.asp
<%@ Language=vbscript%>
<HTML>
<HEAD>
<meta name= "generator" content= "Microsoft Visual Studio 6.0" >
<TITLE> read Cookies For example </TITLE>
</HEAD>
<BODY>
<%response.write "Read Cookie:<br>"
Dim Cookie,key
For all cookies in Request.Cookies
If Request.Cookies (cookie). HasKeys Then
Response.Write "<br>cookie Name:" &cookie& "<BR>--------------<BR>"
For each key in Request.Cookies (cookie)
Response.Write "Key Name:" &key& ", Value:" &request.cookies (cookie) (Ke
Y) & "<BR>"
Next
Else
Response.Write "Cookie Name:" &request.cookies (Cookie) & "<BR>"
End If
Next
%>
</BODY>
</HTML>