Sessions/securing web site pages with a Login

Reply

Join Date: Oct 2005
Posts: 17
Reputation: JC_2000 is an unknown quantity at this point 
Solved Threads: 0
JC_2000 JC_2000 is offline Offline
Newbie Poster

Sessions/securing web site pages with a Login

 
0
  #1
Apr 22nd, 2006
Hi everyone,

Can anyone tell me how you can stop users from URL Hacking your website with ASP (sessions)?
So for example if you have a password and username form on the front of your website and only want authorised members to gain access to your web site.

So for example just say you had a page e.g: somepage.htm and a user who was not logged in types www.somesite.com/somepage.htm. How can you stop them from getting access to the that page if they are not logged in?

P.S: Do you have any sample code?

Please help,

Jay.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 89
Reputation: msaqib is an unknown quantity at this point 
Solved Threads: 1
msaqib msaqib is offline Offline
Junior Poster in Training

Re: Sessions/securing web site pages with a Login

 
0
  #2
May 6th, 2006
  1. <%
  2. Dim lgn,pas ' Login name & Pasword
  3. lgn=cstr(Request("login"))
  4. pas=cstr(REquest("pass"))
  5. if ((lgn="login") AND (pas="123")) then
  6. session("admin") = True
  7. response.Redirect("somepage.asp")
  8. end if
  9.  
  10. 'now if the user have not logged in then
  11. if NOT(session("admin")) then Response.Redirect("NoAccess.asp")
  12. %>

The simplest code will look like this.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 1
Reputation: tparke is an unknown quantity at this point 
Solved Threads: 0
tparke tparke is offline Offline
Newbie Poster

Re: Sessions/securing web site pages with a Login

 
0
  #3
May 9th, 2008
Hi Jay,

Did you manage to solve the URL hacking problem? I have the same situation and would really appreciate it if you could let me know how you got around it.

Thanks,
Tony
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the ASP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC