How can I tell the page I came from?

M

Mufasa

I'm trying to know the page that I came from. If I use
page.request.urlreferrer it seems to only be filled in once I am on one of
the pages within my web site. I'd really like to know what page they came
from outside of the web site.

TIA - Jeff.
 
O

OJ

I'm trying to know the page that I came from. If I use
page.request.urlreferrer it seems to only be filled in once I am on one of
the pages within my web site. I'd really like to know what page they came
from outside of the web site.

TIA - Jeff.

Hmmm......dubious request Jeff!! I don't think it is (easily)
possible. Why would you want to know that? If I were a user I might
say that is absolutely none of your business!

O
 
M

Mufasa

OK then let's see if somebody can solve my problem.

We have a website that we use for documentation. Rather than have people
actually have to log in to it, I was going to set up links of some of our
other website ( where people already have logged in ) and use the place
where they came from to tell what they can see.

So if somebody went to public.xxx.com/docs - they could see a certain set
of files.
If they went to internal.xxx.com/docs - the could see a different set of
files.....

I would then put a redirect in the /docs that would all go to the same place
and it would figure out what your privileges are based on where you came
from. So everything would go to www.xxx.com.

I believe although I haven't tested it completely, that once you change
domains you lose your session variables. I supposed I could put it in the
query string but I don't particularly want it there because the users could
see it.

Any suggestions?

TIA - Jeff.
 
G

George Ter-Saakov

you should know the page where you came from :)

Just kidding.

There is no way except Request.UrlReferer.


Some advice here.

Do not use Request.UrlRefferer.
Use string sRef = Request.ServerVariables["HTTP_REFERER"];

Also always check it for null. Because a lot of AOL proxies do not pass
referrer.

Also if you get malformed referrer's URL the Request.UrlRefferer will throw
an exception when try to convert it to URI object.

George.
 
M

Mark Rae

Also always check it for null. Because a lot of AOL proxies do not pass
referrer.

Not just AOL - more and more ISPs are filtering this out - you can't rely on
it at all...
 
H

Hans Kesting

OK then let's see if somebody can solve my problem.
We have a website that we use for documentation. Rather than have
people actually have to log in to it, I was going to set up links of
some of our other website ( where people already have logged in ) and
use the place where they came from to tell what they can see.

So if somebody went to public.xxx.com/docs - they could see a
certain set
of files.
If they went to internal.xxx.com/docs - the could see a different set
of
files.....

*if* those site really are named <something>.fixeddomain.com, you could
store a cookie with domain "fixeddomain.com". That way all those <something>
sites can receive that cookie.
From there it's up to you again ...

Hans Kesting
 
G

Guest

The problem is that if somebody types the address into the browser's address
bar and didn't get there by clicking on a link, there won't be anything there.
That's just the way HTTP works.
Peter
 
M

Mythran

Mufasa said:
OK then let's see if somebody can solve my problem.

We have a website that we use for documentation. Rather than have people
actually have to log in to it, I was going to set up links of some of our
other website ( where people already have logged in ) and use the place
where they came from to tell what they can see.

So if somebody went to public.xxx.com/docs - they could see a certain
set of files.
If they went to internal.xxx.com/docs - the could see a different set of
files.....

I would then put a redirect in the /docs that would all go to the same
place and it would figure out what your privileges are based on where you
came from. So everything would go to www.xxx.com.

I believe although I haven't tested it completely, that once you change
domains you lose your session variables. I supposed I could put it in the
query string but I don't particularly want it there because the users
could see it.

Any suggestions?

TIA - Jeff.

OJ said:
Hmmm......dubious request Jeff!! I don't think it is (easily)
possible. Why would you want to know that? If I were a user I might
say that is absolutely none of your business!

O

]


[TROLL TIME FOR A SINGLE POST]
I think it's the public.XXX.com that OJ doesn't want you to KNOW!!!
Mythran

JK of course...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top