当前位置: 移动技术网 > IT编程>开发语言>其他编程 > 如何用Cookie进行登录验证?

如何用Cookie进行登录验证?

2017年12月08日  | 移动技术网IT编程  | 我要评论
login.htm请注册登录随风起舞<form action="checklogin.asp" metho

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>

如您对本文有疑问或者有任何想说的,请 点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网