Solved

referrer information in IIS

Posted on 1998-11-03
6
1,167 Views
Last Modified: 2013-12-25
Does anyone know how to get the referrer information using asp and IIS?
0
Comment
Question by:1stomni
6 Comments
 
LVL 28

Expert Comment

by:sybe
ID: 1856075
<%
Response.write Request.ServerVariables("HTTP_REFERER")
%>

0
 

Author Comment

by:1stomni
ID: 1856076
We have tried this already.  We printed all of the server variables and referer does not show up.  Do we need to set something in IIS to get this information.  Also, what browsers support this?
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1856077
The Referer works in IE and NS for sure.  I have tested in IE 3.x and up and NS 3.x and up.  Also, to use the referer, you must be coming from a site.  You cannot just type in an address.  Also, make sure you spelled it correctly.  It is with one "r" not two.


0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1856078
MasseyM: IE 3.01 and lower does as far as I know not pass the referrer.

In most browsers the referrer is not set when the page with the link is loaded from harddisk or from the location bar. NS 2.0 also passes the referrer.

Michel
0
 
LVL 28

Accepted Solution

by:
sybe earned 100 total points
ID: 1856079
HTTP_REFERER is independent of the browser, it is part of the http-protocol.
MasseyM is right to tell you must come from a site to see it. If there is no referer, the value of HTTP_REFERER is empty.
But it exists nonetheless, as you can see in this ASP-code:

<TABLE BORDER=1 WIDTH=100%>
<TR>
  <TH COLSPAN=2> HTTP / Server Variables</TH>
</TR>
<TR>
  <TD><B>Server Variable</B></TD>
  <TD><B>Value</B></TD>
</TR>
  <% For Each name In Request.ServerVariables %>
<TR>
  <TD> <%= name %> </TD>
  <TD> <%= Request.ServerVariables(name) %> </TD>
</TR>
<% Next %>
</TABLE>




The referer that Michel talks about is the value of the referer in the client (which can be called with javascript). IE3 has a bug in the document.referrer (javascript uses double "r"), which gives it the same value as document.location. In fact you can recognize IE3 by this:

<script>
if (document.referrer == document.location) {
  alert("this browser is MSIE3");
}
</script>
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1856080
Sybe: I might have mixed it up with the stats sites that cannot do referer stats on IE3

I thought the browser did not send it (it IS http client dependant however)

It must be because they use JavaScript to send the referer along to the stats program... now why couldn't they just use the http-referer if what you say is true?

Michel
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Microsoft Edge 9 79
SP to delete duplicates 15 55
Create and populate iFrame onClick of a button? 1 45
Email address on web page 4 36
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now