------------------- index.asp--------------------------
<" CODEPAGE="936"%>
登录页面
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>tc711.com教程测试页面</title>
</head>
<body>
<% UserCookie=request.Cookies("tc711")("UserCookie")
PassCookie=Request.Cookies("tc711")("PassCookie")
OKCookie=request.Cookies("tc711")("OKCookie")%>
<form action="check.asp" method="post">
<p>用户:<input name="username" id="username" type="text" value="<%= UserCookie %>"/></p>
<p>密码:<input name="passwords" type="password" id="passwords" value="<%= PassCookie %>"/>
</p>
<p>记住密码:<input name="OK" type="checkbox" id="OK" value="1" <% If OKCookie="1" Then %>checked <% End If %>/>
</p>
<input type="submit" name="button" id="button" onclick="cheak();" value="提交" />
</form>
</body>
</html>
验证页面
------------------- check.asp--------------------------
<%if trim(request("OK"))="1" then '用来判断是否有选择记住密码
Response.Cookies("tc711")("UserCookie") =Trim(request("username"))
Response.Cookies("tc711")("PassCookie")=trim(request("passwords"))
Response.Cookies("tc711")("OKCookie")=trim(request("OK"))
response.cookies("tc711").expires=date+365
%>登录成功!
<% else %>
登录失败!
<% End If %>
<a href="/">返回</a>