944,191 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Unsolved
  • Views: 2858
  • ASP RSS
Apr 22nd, 2006
0

Sessions/securing web site pages with a Login

Expand Post »
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.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
JC_2000 is offline Offline
17 posts
since Oct 2005
May 6th, 2006
0

Re: Sessions/securing web site pages with a Login

ASP Syntax (Toggle Plain Text)
  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.
Reputation Points: 9
Solved Threads: 1
Junior Poster in Training
msaqib is offline Offline
91 posts
since Sep 2004
May 9th, 2008
0

Re: Sessions/securing web site pages with a Login

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
Reputation Points: 10
Solved Threads: 0
Newbie Poster
tparke is offline Offline
1 posts
since May 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: Drop Down menu
Next Thread in ASP Forum Timeline: checkbox checkchanged event not firing in datalist control





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC