http_referer different than document.referrer - why?

M

Mike Dee

Hi All - I'm having a strange problem I'm wondering if anyone can shed some
light on.

When I use ASP or ASP.NET code to get the referrer information from the
server side, it comes back as null. However in these same cases
document.referrer returns the valid referrer. What could cause this?

In other words, with the following line:
ref = Request.ServerVariables("HTTP_REFERER") (or its ASP.NET equivalent)

ref is set to ""

However if in the same page I add this code:

<script>
alert("ref: " + document.referrer);
</script>

Then I get a JS alert showing the corrct referrer value. I've also tried
using "HTTP_REFERRER" (two Rs) and it doesn't make a difference.

So why would the client side approach return the correct value at a time
when the server-side approch does not?

Thanks in advance for any thoughts or ideas you have on this! It is driving
me nuts.

--- Mike
 
B

Bruce Barker

many proxy servers strip the referer header, also the browser may be set to
not send it.

-- bruce (sqlwork.com)
 

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,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top