首页 编程 正文

如何决定是否将登录内容保存到Cookie里?_编程10000问_

2023-05-26 00:21:54 31

login.htm

<% @ Language=javascript %>
<%
if (Request.Cookies("SavedLogin").HasKeys) {
    Response.Redirect("checklogin.asp?Cookie=1")
}
%>


</span><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 9.0pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">精彩春风之登录页面</span><span lang="EN-US" style="FONT-FAMILY: ''; mso-bidi-font-size: 9.0pt">



我要登录随风起舞


    电子邮件:

   
口令:


    要把登录内容存为Cookie?


    登录">

 

checklogin.asp
<%
dim strEmail
if Request.QueryString("Cookie") = 1 then
    strEMail = Request.Cookies("SavedLogin")("Email")
else
    strEMail = Request.Form("email")
end if

dim bLoginSaved

if Request.Form("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
%>


</span><span style="FONT-FAMILY: 宋体; mso-bidi-font-size: 9.0pt; mso-ascii-font-family: ''; mso-hansi-font-family: ''">精彩春风之登录验证</span><span lang="EN-US" style="FONT-FAMILY: ''; mso-bidi-font-size: 9.0pt">




<% if bLoginSaved then %>
   
将登录信息保存到Cookie里去



<% end if %>
欢迎光临随风起舞!



<% if Request.QueryString("Cookie") = 1 then %>
    保存成功!


<% end if %>
请确认您的电子邮件: <% = strEMail %>

-六神源码网 -六神源码网