If RememberLogin=true Then
Response.Cookies("Cookie")("key1") = UserName
Response.Cookies("Cookie")("key2") = UserPwd
Response.Cookies("Cookie").Expires = Date()+30
End If
檢查權限的時候:
'讀取非空Cookie自動登錄
dim clUserName,clUserPwd
clUserName = Request.Cookies("Cookie")("key1")
clUserPwd = Request.Cookies("Cookie")("key2")
If Session("User")="" Then
Call Login_Cookies() '調用登錄過程
End If
'登錄過程
Sub Login_Cookies()
If Session("User")="" and clUserName<>"" and clUserPwd<>"" Then
登錄代碼,寫Session值代碼,與單獨登錄壹樣
End If
End Sub