Where request came from/referrer

G

Guest

I am trying to find where my user came from - in particular whether they came
from our application login on our own site or whether they came by keying the
url directly without going through our login.

Currently I am using the following code, but would be happy to change to
something more effective.
Dim MyUrl As Uri = Request.UrlReferrer
If MyUrl Is Nothing Then
gvMyUrl = "nothing"
Else
gvMyUrl = MyUrl.ToString
End If


No matter how the user comes to my app I am getting "nothing". That is to
be expected if keying the URL directly. When using the logon I am still
getting nothing. Is that because it is coming from a secure site (the logon)
to my app which is not on a secure site?

Any ideas how to get this "where from" info.

Thanks for any help I can get. I am desperate to solve this and not really
experienced in this area.
 
B

bruce barker \(sqlwork.com\)

UrlRefer is filled in by the browser and optional. Many proxy servers will
strip it for security reasons, I expect most browsers will all stop
supporting it. if your want to know where in your site a link came from, add
a url parameter to it.

http://mysite/somepage.aspx?source=login


-- bruce (sqlwork.com)
 
G

Guest

As you seem to already know, UrlReferrer will only work with requests that
load in the same or another browser window invoked via a hyperlink.

No UrlReferrer object is returned when loading pages into a window using
client-side scripting methods.

Also, corporate firewalls can interfere with the ability to get this
information, as can various types of privacy and anti-virus / anti-malware
software.

If all you really need to know is whether somebody "got here" after logging
into your secure site, why not either just put something on the querystring
to your app that determines this or if it is the same application, set a
session variable "LoggedIn" to true, or set a cookie after they have logged
in and then read it when they arrive at your app?
Peter
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top