Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
Thread: How to script 'Session'?
01-10-2014, 12:19 AM #1
- Join Date
- Nov 2005
- Thanked 1 Time in 1 Post
How to script 'Session'?
I have a log-in page that verifies user details against an online MS Access database. Three ASP files do this: a login script, a 'check details' script, and the final script which displays the database table in a Web page.
The problem I have is this: when user A logs in he can see the details of the other users, which I don't want. I understand that I need to use 'Session' for this so that user A can only see his own details (let's say he is tracking an order online), but there are scant examples on the Internet about how to use 'session'.
So, I am groping in the dark, but would the script be something like this?
<% IF Request.form="" THEN %> <html> <title>Our private pages</title> <body> In order to access this pages fill the form below:<BR> <form method="post" action="login.asp"> Username: <input type="text" name="email" size="20"><BR> Password: <input type="password" name="wolfID" size="15"><BR> <input type="Submit" value="Submit"> <% IF Session("wolfID")<>="" THEN %> welcome to Page 1 <BR> 'find all nessesary data for wolfID and display this users record only <A HREF="page1.asp">Page 1</A> <% ELSE %> Sorry, access is refused/Error in username or password <A HREF="page2.asp">Page 2</A> <%end if%> </form> %>
Thanks for any advice.