Hi all
I am just starting to get into ASP but I not an experinced programer so I was wondering if you could hep me, I am have built a pretty basic login page with UserID, Password and User Level which is linked to an Access DB to lookup the ID and Password. When the correct ID and password are typed you are directed to a loginok.asp page.
The Problem
The problem I have is that it is possible to bookmark the loginok.asp once logged in from the browser therfore bypassing the login in future cases. Also I dont want them to be able to type in the full URL ( I have prevented the browser from caching the page but do not know how to get round the bookmark thing. I think I need to use a Session or some sort of way to expire the page however I am unfamilar with this. I created the sessions on the login page but do not know how to call them to expire on the loginok.asp
I have included the code below to
<%@LANGUAGE="VBSCRIPT"%> <%
Dim myconnection__strUserID
myconnection__strUserID = "x"
if(Request.Form("UserID" <> "" then myconnection__strUserID = Request.Form("UserID"
Dim myconnection__strPassword
myconnection__strPassword = "1"
if(Request.Form("Password" <> "" then myconnection__strPassword = Request.Form("Password"
%>
<%
set myconnection = Server.CreateObject("ADODB.Recordset"
myconnection.ActiveConnection ="dsn=password;"
myconnection.Source = "SELECT * FROM Table1 WHERE UserID = '" + Replace(myconnection__strUserID, "'", "''" + "' AND Password = '" + Replace(myconnection__strPassword, "'", "''" + "'"
myconnection.Open
%>
<%
If myconnection__strUserID <> "x" Then
If Not myconnection.EOF Then
Session("svUser"=myconnection.Fields.Item("UserID".Value
Session("svPass"=myconnection.Fields.Item("Password".Value
Session("svAccess"=myconnection.Fields.Item("userLevel".Value
Response.Redirect "loginok.asp"
else
Response.Redirect "loginfailed.asp"
End If
End If
%>
I appolgise as I am using Ultradev, many thanks in advance
Indy
I am just starting to get into ASP but I not an experinced programer so I was wondering if you could hep me, I am have built a pretty basic login page with UserID, Password and User Level which is linked to an Access DB to lookup the ID and Password. When the correct ID and password are typed you are directed to a loginok.asp page.
The Problem
The problem I have is that it is possible to bookmark the loginok.asp once logged in from the browser therfore bypassing the login in future cases. Also I dont want them to be able to type in the full URL ( I have prevented the browser from caching the page but do not know how to get round the bookmark thing. I think I need to use a Session or some sort of way to expire the page however I am unfamilar with this. I created the sessions on the login page but do not know how to call them to expire on the loginok.asp
I have included the code below to
<%@LANGUAGE="VBSCRIPT"%> <%
Dim myconnection__strUserID
myconnection__strUserID = "x"
if(Request.Form("UserID" <> "" then myconnection__strUserID = Request.Form("UserID"
Dim myconnection__strPassword
myconnection__strPassword = "1"
if(Request.Form("Password" <> "" then myconnection__strPassword = Request.Form("Password"
%>
<%
set myconnection = Server.CreateObject("ADODB.Recordset"
myconnection.ActiveConnection ="dsn=password;"
myconnection.Source = "SELECT * FROM Table1 WHERE UserID = '" + Replace(myconnection__strUserID, "'", "''" + "' AND Password = '" + Replace(myconnection__strPassword, "'", "''" + "'"
myconnection.Open
%>
<%
If myconnection__strUserID <> "x" Then
If Not myconnection.EOF Then
Session("svUser"=myconnection.Fields.Item("UserID".Value
Session("svPass"=myconnection.Fields.Item("Password".Value
Session("svAccess"=myconnection.Fields.Item("userLevel".Value
Response.Redirect "loginok.asp"
else
Response.Redirect "loginfailed.asp"
End If
End If
%>
I appolgise as I am using Ultradev, many thanks in advance
Indy