473,396 Members | 2,011 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,396 software developers and data experts.

Where request came from/referrer

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.

Apr 11 '06 #1
2 2133
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
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Sega" wrote:
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.

Apr 11 '06 #2
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)



"Sega" <Se**@discussions.microsoft.com> wrote in message
news:61**********************************@microsof t.com...
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.

Apr 11 '06 #3

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

Similar topics

2
by: JW | last post by:
I use Request.ServerVariables("HTTP_REFERER") to get the URL of the referrer page. However, if the page that has Request.ServerVariables("HTTP_REFERER") is in a popup window then the value is...
10
by: Bo Rasmussen | last post by:
Hi, I have a problem : I have a form with some buttons. When one of these buttons is pressed a new URL with some parameters to e.g. delete something from a database. The problem is that when the...
4
by: Harley | last post by:
i have found a problem when using Request.UrlReferrer. if i call the page using a javascript function, the referrer is null... i need to call a page and open it on a specific browser size, with no...
1
by: | last post by:
I've got \\root\folder\Page2.aspx that I want to controll access to, by establishing a rule that says "previous URL must be '\\root\folder\Page1.aspx' (which did password validation). The code...
7
by: Yongsub Eric Shin | last post by:
Hi. I'm just a beginner in ASP.Net. I started writing codes and I keep on getting this Runtime Error page, where it says "Description: An application error occurred on the server. The current...
4
by: Wayne Wengert | last post by:
I want to restrict access to a specific ASP.NET page base on the calling URL. I am trying the code below to get the calling URL but I get an error "Object reference not set to an instance of an...
3
by: Stephane | last post by:
Hi, I have installed an image on some html page. This image is sent from an asp.net page like this: <img src="image.aspx"> I have a problem with few computers. In my application, I check...
7
by: Aaron Prohaska | last post by:
Has anyone had any experience with Nortan Antivirus causing problems when trying to use Request.UrlReferrer? I am seeing in the Nortan Antivirus log that its blocking my page from loading because...
0
by: Tony | last post by:
I'm trying to capture referrer information. the requests are the first lines of code in the page load sub. Request.UrlReferrer.tostring 'produces the name on of my site not the referrer...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.