ASP login to save data to cookies

Source: Internet
Author: User

This is based on the user's choice whether to allow the user name password to be saved in the cookie Oh, we pay special attention to the code blue codes Oh.

Set Rs=server.createobject ("Adodb.recordset")
Exec= "SELECT * from Yrwl_tb_admin where yhm= '" &yhm& ""
Rs.Open exec,conn,1,1
If not rs.eof then
If SetPwd (pass) <> RS ("pass") then
DL = "0"
Else
CS = RS ("cs")
If IsNull (CS) THEN cs = 0
CS = cs + 1
ZHSJ = RS ("ZHSJ")
If IsNull (ZHSJ) then ZHSJ = "First Login"
Session (sessionvalue& "ZHSJ") = ZHSJ
If jy= "1" Then
Response.Cookies ("bbsyhm") = Yhm
Response.Cookies ("bbspass") = Pass
Else
Response.Cookies ("bbsyhm") = ""
Response.Cookies ("bbspass") = ""
End If
Session (sessionvalue& "pass") =pass
Session (sessionvalue& "YHM") = Yhm
Session (sessionvalue& "LXFS") = RS ("Lxfs")
Session (sessionvalue& "sp") = RS ("wz")
Session (sessionvalue& "id") = CStr (RS ("id"))
Session (sessionvalue& "JB") = RS ("JB")
Session (sessionvalue& "QM") = RS ("QM")
EXEC1 = "Update yrwl_tb_admin SET cs =" +cstr (CS) + ", ZHSJ = ' +jdsj+" ' where yhm = ' "+yhm+ '"
Conn.execute EXEC1
EXEC1 = "INSERT into YRWL_TB_DLXX (YHM,SJ,CK) VALUES (' &yhm&" ', ' &jdsj& ', ' paste ') "
Conn.execute EXEC1
If CZ = "index" then Response.Redirect "index.asp"
End If
Else
DL = "0"
End If
If DL = "0" then%>
<script language= "JavaScript" >
Alert ("User name or password is wrong!") ");
if ("<%=cz%>" = "bg") window.location= "index.asp";
Window.location= "tb_dl.asp";
</script>
<%else
Rs.close
Conn.close%>
<script language= "JavaScript" >
parent.window.location.href= ' index.asp ';
parent.window.frames[' bbslx '].location.href= ' bbs_lx.asp ';
window.location = "bbs_list.asp";
</script>
<%end if

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.