473,406 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How do I prevent users from viewing a webpage directly by typing in its URL?

What is an effect way to prevent users from viewing a webpage directly by
typing in its URL?

For example: If a default page is set up as a login screen with user name
and password.

The user types in correct information and clicks the submit button.

The next webpage comes up, displaying its URL. So what's to stop the user
bypassing the login screen next time around? I would like to show an access
denied message if this happens. Any suggestions?

S
Nov 17 '05 #1
2 3940
"swbaz" <sw***@highstream.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
What is an effect way to prevent users from viewing a webpage directly by
typing in its URL?

For example: If a default page is set up as a login screen with user name
and password.

The user types in correct information and clicks the submit button.

The next webpage comes up, displaying its URL. So what's to stop the user
bypassing the login screen next time around? I would like to show an access denied message if this happens. Any suggestions?


You should look into Forms Authentication.

Otherwise, the only way to control what the user does in the browser is to
write your own browser.
--
John Saunders
Internet Engineer
jo***********@surfcontrol.com

Nov 17 '05 #2
Personally...

I have all of my aspx.vb pages derive themselves from a general template.
Now I know this isn't what you're asking, but in the template I have a few
public properties, one of them being AccessLevel. So basically, on each aspx
page, I define the access level and then it checks it based on user session
info. here is an example...

Private _accessLevel As String = "Not Set"

Public Property AccessLevel(ByVal pageLevel As String)

Get

Return _accessLevel

End Get

Set(ByVal Value)

_accessLevel = pageLevel

Select Case _accessLevel

Case "General"

'do nothing, no access needed

Case "User"

If Not Session("UserLoggedIn") Then

Response.Redirect("default.aspx")

End If

End Select

End Set

End Property

and then from each page in the Page_Load I say:

Me.AccessLevel="General" or "User" or "Admin" and that restricts the page
each time it is accessed!
"Marc" <no****@nospam.com> wrote in message
news:eC**************@TK2MSFTNGP10.phx.gbl...
You could use the Session_Start subroutine in Global.asax

Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
' If the Session variable User is defined, then we can assume the
user has logged in.
' Otherwise, redirect to the Login.aspx page (assumed to be in the
root folder).

If Session("User") Is Nothing Then
Response.Redirect("/" & Request.Url.Segments(1).ToString &
"Login.aspx", True)
End If
End Sub

"swbaz" <sw***@highstream.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
What is an effect way to prevent users from viewing a webpage

directly by
typing in its URL?

For example: If a default page is set up as a login screen with user

name
and password.

The user types in correct information and clicks the submit button.

The next webpage comes up, displaying its URL. So what's to stop the

user
bypassing the login screen next time around? I would like to show

an access
denied message if this happens. Any suggestions?

S


Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Brian Maupin | last post by:
I have a refreshing webcam shot on my site and I was wondering if there was a way I could display how many people are currently viewing it? Thanks in advance.
102
by: me | last post by:
How do I prevent the save/print/email/mypictures toolbar from popping up when IE users place their cursor over photos at my website? Thank you in advance for your help. Signed, me
11
by: hazz | last post by:
before I start filling up the first page of perhaps many pages of code with if/then or switch:case buckets, I wanted to step back and see if there is a better way... I will have a table with up to...
8
by: Arno R | last post by:
Hi all, Is the above possible? I guess I need an API call for this ? How and where to find this? One of my new apps is used as a sort of 'dedicated' thing. Users see an empty desktop with...
3
by: Ben | last post by:
Hello I am in the final stages of developing my asp.net app and have a question. The app im creating has two frames, one being a menu and the other showing the detail. I would like to prevent...
5
by: JohnC | last post by:
I have a webapp that allows users to delete/add content on a webpage. The webpage is accessed like this: www.abc.com/app/user1/ www.abc.com/app/user2/ where index.aspx is the default page. ...
3
by: Phil | last post by:
Jerry posed some good ideas, a while back, on website a security issue that comes up often. Gary Jones was asking how to keep users from directly accessing php pages, out of sequence. Jerry...
3
by: mfetterhoff | last post by:
Hello Experts.. Im checking out the other side of the tracks here.. always been a Systems Analyst kind of guy. Developers are a touchy and unpredictible lot. I try to give them their space and never...
4
by: Luqman | last post by:
How can I Prevent user from accessing any page directly without Login ? User should not be able to by pass the Login screen by typing the Url of any page directly. I am using ASP.Net 2.0 with...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.