好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

如何用Cookie进行登录验证?_编程10000问_

NEWSZW_HZH_BEGIN-->

login.htm
请注册登录随风起舞
<FORM ACTION="checklogin.asp" METHOD="POST">
    电子邮件 : <input TYPE="Text" NAME="email" SIZE="40">
    密码 : <input TYPE="Password" NAME="Password" SIZE="40">
    <input TYPE="Checkbox" NAME="SaveLogin" value="ON"> 您要将注册内容保存为 Cookie 吗 ?
    <input TYPE="Submit" VALUE=" 登录 "><input TYPE="RESET">
</FORM>

checklogin.asp
<%
dim bLoginSaved
if Request("SaveLogin") = "on" then
    Response.Cookies("SavedLogin")("EMail") = Request("email")
    Response.Cookies("SavedLogin")("pw") = Request("password")
    Response.Cookies("SavedLogin").Expires = Date + 30
    bLoginSaved = True
else
    bLoginSaved = False
end if
%>

<html>
<head>

<title> 山水盈盈之登录验证 </title>

</head>
<body>
<% if bLoginSaved then %>
    将注册内容保存到 Cookie<HR>
<% end if %>
欢迎光临随风起舞 !<P>
请确认您的电子邮件 : <% = Request("email") %>
</body></html>

NEWSZW_HZH_END-->

查看更多关于如何用Cookie进行登录验证?_编程10000问_的详细内容...

  阅读:39次