如何決定是否將登錄內(nèi)容保存到Cookie里?
login.htm
<% @ Language=javascript %>
<%
if (Request.Cookies("SavedLogin").HasKeys) {
Response.Redirect("checklogin.asp?Cookie=1")
}
%>
<html>
<head>
<title>精彩春風(fēng)之登錄頁(yè)面</title>
</head>
<body>
我要登錄隨風(fēng)起舞
<FORM ACTION="CheckLogin.asp" METHOD="POST">
電子郵件: <INPUT TYPE="Text" NAME="email" SIZE="40"><BR>
口令: <INPUT TYPE="Password" NAME="Password" SIZE="40"><P>
<INPUT TYPE="Checkbox" NAME="SaveLogin"> 要把登錄內(nèi)容存為Cookie嗎?<P>
<INPUT TYPE="Submit" VALUE="登錄"><INPUT TYPE="RESET">
</FORM>
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
%>
<html>
<head>
<title>精彩春風(fēng)之登錄驗(yàn)證</title>
</head>
<body>
<% if bLoginSaved then %>
將登錄信息保存到Cookie里去<HR>
<% end if %>
歡迎光臨隨風(fēng)起舞!<P>
<% if Request.QueryString("Cookie") = 1 then %>
保存成功!<P>
<% end if %>
請(qǐng)確認(rèn)您的電子郵件: <% = strEMail %>
</body></html>
相關(guān)文章
統(tǒng)計(jì)在線人數(shù)是實(shí)時(shí)的嗎?
統(tǒng)計(jì)在線人數(shù)是實(shí)時(shí)的嗎?...2006-11-11如何實(shí)現(xiàn)某一頁(yè)面只讓特定的用戶瀏覽?
如何實(shí)現(xiàn)某一頁(yè)面只讓特定的用戶瀏覽?...2006-11-11如何讓用戶再次訪問(wèn)我的網(wǎng)站時(shí)不需再提交相關(guān)信息?
如何讓用戶再次訪問(wèn)我的網(wǎng)站時(shí)不需再提交相關(guān)信息?...2006-11-11