Forum Moderators: open
I'm trying to pass a HTTP_REFERER server variable to a page
Sample Code:
<%
Dim Domain
Dim uid
Dim restrictedurl
Domain = Request.ServerVariables("LOGON_USER")
uid = UCase(Right(Domain,(Len(Domain) - Instr(1,Domain,"\", vbTextCompare))))
restrictedurl = Request.ServerVariables("HTTP_REFERER")
%>
When its linked directly, the variables all show up fine using
Name: <%=uid %>
UserID: <%=Domain %>
URL: <%=restrictedurl %>
However, if using a "meta-refresh" the HTTP_REFERER Server variable shows blank (because its not being passed from the meta-refreshed originating page)
Anyone know how to pass the HTTP_REFERER server variable along?
TIA,
Patrick Elward
However, if using a "meta-refresh" the HTTP_REFERER Server variable shows blank (because its not being passed from the meta-refreshed originating page)
Well, META refresh is performed by the client (browser), so I can't really see what you can do on server side to influence decision to pass or not pass the referer, which IMO should be passed.
is there a way to 'pass along' this value in the string?
No! Its up to the client to decide whether to pass referer or not, and you have no control over it! Internet Explorer won't pass referer for windows opened with JavaScript, some other browsers do, it all depends on client.
I just did a test on my local machine and referer is not passed by Firefox and Explorer, however if you click on that URL referer is passed as intended. I therefore conclude that referer is not passed and not supposed to be passed (or both Firefox and IE teams are wrong).
You can try 302 Permanently moved response code to see if it gives better results than META REFRESH.