I am thourougly baffled with a login, that im trying to ensure is remembered when a checkbox is selected at login.
I have:
valRemember = Request.Form("remember"
If Session("Username" <> "" And Session("Password" <> "" Then
valUsername = Session("Username"
valPassword = Session("Password"
Else
valUsername = Request.Form("Username"
valPassword = Request.Form("Password"
End If
'connection object
set conn = server.createobject("adodb.connection"
conn.open Application("strConn"
'recordset object
set rs = server.createobject("adodb.recordset"
'set sql
sql="SELECT Username, Password FROM owner WHERE Username='" & valUsername &"' AND Password='" & valPassword & "'"
'open everything
rs.open sql, conn, 1
'create the session here for the logged in user - session value is the username
'and can be referenced throughout the site with 'session("Username"'
If Not rs.EOF Then
Session("Username" = rs("Username"
Session("Password" = rs("Password"
If remember <> "" Then
Session.Timeout = 300
End If
Response.Redirect("records/admin_scripts/index.asp"
End If
'close recordset
rs.Close
%>
--------------
Im basically tring to ensure that when someone logs in, and opts to be remembered when they close their Internet explorer and go back to the login page, 2 sessions for username and password are remembered, tested in the SQL and all is good.
Anyone see what is wrong with the code.
Thanks
Dave
I have:
valRemember = Request.Form("remember"
If Session("Username" <> "" And Session("Password" <> "" Then
valUsername = Session("Username"
valPassword = Session("Password"
Else
valUsername = Request.Form("Username"
valPassword = Request.Form("Password"
End If
'connection object
set conn = server.createobject("adodb.connection"
conn.open Application("strConn"
'recordset object
set rs = server.createobject("adodb.recordset"
'set sql
sql="SELECT Username, Password FROM owner WHERE Username='" & valUsername &"' AND Password='" & valPassword & "'"
'open everything
rs.open sql, conn, 1
'create the session here for the logged in user - session value is the username
'and can be referenced throughout the site with 'session("Username"'
If Not rs.EOF Then
Session("Username" = rs("Username"
Session("Password" = rs("Password"
If remember <> "" Then
Session.Timeout = 300
End If
Response.Redirect("records/admin_scripts/index.asp"
End If
'close recordset
rs.Close
%>
--------------
Im basically tring to ensure that when someone logs in, and opts to be remembered when they close their Internet explorer and go back to the login page, 2 sessions for username and password are remembered, tested in the SQL and all is good.
Anyone see what is wrong with the code.
Thanks
Dave