By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,035 Members | 1,555 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,035 IT Pros & Developers. It's quick & easy.

Check if user went randomly to a page.

P: n/a
What is the best way to check if a user got to one of my pages by just
typing in the page in the URL line verses one of the pages from my site.

I see this in lots of places. If I have a page that can be gotten to by
pages "A", "B", "C" and "D" - this is fine. But any other way, I want it to
send a message saying they are not authorized or to go directly to a logon
page.

I am using Forms Authentication.

Thanks,

Tom.
Nov 19 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Forms Authentication is your best bet.
It is easily configured in your web.config file.
Here's more information:
http://www.dotnetbips.com/displayarticle.aspx?id=9
--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


"tshad" <ts**********@ftsolutions.com> wrote in message
news:uj****************@TK2MSFTNGP12.phx.gbl...
What is the best way to check if a user got to one of my pages by just
typing in the page in the URL line verses one of the pages from my site.

I see this in lots of places. If I have a page that can be gotten to by
pages "A", "B", "C" and "D" - this is fine. But any other way, I want it
to send a message saying they are not authorized or to go directly to a
logon page.

I am using Forms Authentication.

Thanks,

Tom.

Nov 19 '05 #2

P: n/a
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:%2********************@TK2MSFTNGP09.phx.gbl.. .
Forms Authentication is your best bet.
It is easily configured in your web.config file.
Here's more information:
http://www.dotnetbips.com/displayarticle.aspx?id=9
That is how I have it set up now.

What I am trying to prevent is someone doing something like bookmarking the
page for later, logging onto another page then going directly to a page
without going through the normal paths. He would be able to do this if he
is already authenticated and the session (cookie) has not not timed out.

Tom


--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


"tshad" <ts**********@ftsolutions.com> wrote in message
news:uj****************@TK2MSFTNGP12.phx.gbl...
What is the best way to check if a user got to one of my pages by just
typing in the page in the URL line verses one of the pages from my site.

I see this in lots of places. If I have a page that can be gotten to by
pages "A", "B", "C" and "D" - this is fine. But any other way, I want it
to send a message saying they are not authorized or to go directly to a
logon page.

I am using Forms Authentication.

Thanks,

Tom.


Nov 19 '05 #3

P: n/a
"tshad" <ts**********@ftsolutions.com> wrote in
news:uj**************@TK2MSFTNGP12.phx.gbl:
What is the best way to check if a user got to one of my pages
by just typing in the page in the URL line verses one of the
pages from my site.

I see this in lots of places. If I have a page that can be
gotten to by pages "A", "B", "C" and "D" - this is fine. But
any other way, I want it to send a message saying they are not
authorized or to go directly to a logon page.

I am using Forms Authentication.


Tom,

Use Request.UrlReferrer to find out which page the user just came
from.

--
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/
Nov 19 '05 #4

P: n/a
You could use a Session variable to keep track of which "step" the user is
on.
Then on each page make sure they're on the correct step and haven't jumped
to a step they shouldn't be on. You can redirect them to the correct step.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"tshad" <ts**********@ftsolutions.com> wrote in message
news:ue****************@TK2MSFTNGP11.phx.gbl...
"Steve C. Orr [MVP, MCSD]" <St***@Orr.net> wrote in message
news:%2********************@TK2MSFTNGP09.phx.gbl.. .
Forms Authentication is your best bet.
It is easily configured in your web.config file.
Here's more information:
http://www.dotnetbips.com/displayarticle.aspx?id=9


That is how I have it set up now.

What I am trying to prevent is someone doing something like bookmarking
the page for later, logging onto another page then going directly to a
page without going through the normal paths. He would be able to do this
if he is already authenticated and the session (cookie) has not not timed
out.

Tom


--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


"tshad" <ts**********@ftsolutions.com> wrote in message
news:uj****************@TK2MSFTNGP12.phx.gbl...
What is the best way to check if a user got to one of my pages by just
typing in the page in the URL line verses one of the pages from my site.

I see this in lots of places. If I have a page that can be gotten to by
pages "A", "B", "C" and "D" - this is fine. But any other way, I want
it to send a message saying they are not authorized or to go directly to
a logon page.

I am using Forms Authentication.

Thanks,

Tom.



Nov 19 '05 #5

P: n/a
UrlReferrer is not a required field. Most proxy servers and a lot of
firewalls will strip that field out of the requests.

"Chris R. Timmons" wrote:
"tshad" <ts**********@ftsolutions.com> wrote in
news:uj**************@TK2MSFTNGP12.phx.gbl:
What is the best way to check if a user got to one of my pages
by just typing in the page in the URL line verses one of the
pages from my site.

I see this in lots of places. If I have a page that can be
gotten to by pages "A", "B", "C" and "D" - this is fine. But
any other way, I want it to send a message saying they are not
authorized or to go directly to a logon page.

I am using Forms Authentication.


Tom,

Use Request.UrlReferrer to find out which page the user just came
from.

--
Hope this helps.

Chris.
-------------
C.R. Timmons Consulting, Inc.
http://www.crtimmonsinc.com/

Nov 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.