display user specific data after login classic asp

I have this code for my project and i want the user to be directed to their account page which displays data specific to them. ie their list of suppliers. I realise i need to create a session variable but i dont know where to put it in my code and i dont know the code to specify the user in the account page. Can anyone help? Here is my code.\[code\]<%'Connection StringDim Conn'Query to be executedDim SQLQuery'RecordsetDim rs'StudentNo Of Logged in userDim UserName'Password of UserDim Password'Getting information from submitted formUserName = request.form("username")Password = request.form("password")RememberMe = request.form("rememberme")'If not blank Username password submittedif UserName <> "" or Password <> "" then 'Creating connection Object set Conn=server.createobject("ADODB.Connection")'Creating Recordset Object set rs = Server.CreateObject("ADODB.Recordset") 'Initialising Provider String connStr = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ="& Server.MapPath("database.mdb")&";" 'Opening Connection to Database Conn.open connStr 'Query to be executed SQLQuery = "select * from customers_tbl where c_email = '"&UserName&"' AND c_password = '"&Password&"'" 'Retrieving recordset by executing SQL set rs=Conn.execute(SQLQuery) 'If no records retrieved if rs.BOF and rs.EOF then Response.Redirect "customerlogin.htm?username=" & UserName else 'If remember me selected if RememberMe = "ON" then'Writing cookies permanently Response.Cookies("UserName")=UserName Response.Cookies("Password")=Password Response.Cookies("UserName").Expires = Now() + 365 Response.Cookies("Password").Expires = Now() + 365 Response.Redirect "customeraccount.htm"else'writing cookies temporarily Response.Cookies("UserName")=UserName Response.Cookies("Password")=Password Response.Redirect "customeraccount.htm"end if 'Closing all database connections Conn.Close rs.close set rs = nothing set Conn = nothing end ifelse 'Invalid User Response.Redirect "customerlogin.htm?UserName=blank"end if%>\[/code\]
 
Top