當前位置:編程學習大全網 - 編程軟體 - asp編程如何讓登陸狀態保持1個月

asp編程如何讓登陸狀態保持1個月

登錄的時候:

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

  • 上一篇:自動化(嵌入式軟件外包)主要學什麽?就業前景怎麽樣? 在臨沂大學呢?
  • 下一篇:如何用.net進行3d圖形編程?
  • copyright 2024編程學習大全網