当前位置:Gxlcms > PHP教程 > php使用Cookie进行登录验证的小例子

php使用Cookie进行登录验证的小例子

时间:2021-07-01 10:21:17 帮助过:4人阅读

2、登录检测页面 checklogin.asp

  1. <%
  2. dim bLoginSaved
  3. if Request("SaveLogin") = "on" then
  4. Response.Cookies("SavedLogin")("EMail") = Request("email")
  5. Response.Cookies("SavedLogin")("pw") = Request("password")
  6. Response.Cookies("SavedLogin").Expires = Date + 30
  7. bLoginSaved = True
  8. else
  9. bLoginSaved = False
  10. end if
  11. %>

3、登录成功页面

  1. 登录验证
  2. <% if bLoginSaved then %>
  3. 将注册内容保存到Cookie
  4. <% end if %>
  5. 欢迎光临!

  6. 请确认您的电子邮件: <% = Request("email") %>

人气教程排行