Home >Backend Development >PHP Tutorial >A small example of php using cookies for login verification

A small example of php using cookies for login verification

WBOY
WBOYOriginal
2016-07-25 09:05:19998browse
  1. Email:
  2. Password: < ;input TYPE="Password" NAME="Password" SIZE="40">
  3. Do you want to save the registration content as a cookie?
Copy code

2. Login detection page 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. %>
Copy code

3. Login success page

  1. Login Verification
  2. <% if bLoginSaved then %>
  3. will Registration content is saved to Cookie
  4. <% end if %>
  5. Welcome!

  6. Please confirm your email: <% = Request("email") %>
Copy code


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn