session variables

H

Hugh Welford

Hi...What has happened to ("HTTP_REFERER") ? I have used it in the past with
great success, but it seems to have disappeared, or at least return a blank.

I used the routine
<%for each key in request.servervariables%>
<% = key %>
<%response.write " " & request.servervariables(key) & "<br>"
next %>

to print them all out. ("HTTP_REFERER") didnt appear, and neither did any
of them contain the refering URL.

Any explanations? And how can I get hold of the the refering URL if it is no
longer obtainable by this method

Thanks Hugh
 
J

Jon Spivey

Hugh,
Not being funny but are you actually opening this page via a link and not
typing the url direct into your browser?

Referer is still available although there's some situations in which it
won't work as expected, re
http://www.aspfaq.com/show.asp?id=2169

Maybe one of these applies. Also some privacy software actually renames
referer to weferer so obviously it wont be available

Jon
microsoft MVP - FP
 
H

hugh Welford

Hi Jon...thanks for the reply. Yes, I am opening the page from a google
search result page link. I am trying to keep a rudimentary check on who
comes to the site and where from using response.write
request.sessionvariables("HTTP_REFERER"). My first attempt to run this
on-line crashed the page with and ODBC error (funny???), and subsequent
attempts result in a null value being returned. The code I referred to was
run from front page as an attempt to print out all the session variables
available from the collection, but HTTP_REFERER wasnt listed.

Hugh
 
K

Kevin Spencer

In the article Jon referenced, there were nine situations listed in which
HTTP_REFERER would be empty. Are you sure that one of them was not
responsible? For example, a JavaScript location.href or location.replace()
function call. Are you sure that Google doesn't use such a thing?

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
C

chris leeds

I got hosed trying to pass a page to a form but couldn't because the form
was on a page that got opened from a JavaScript pop-up. I wound up sending
the script name in the url string and then putting it into a hidden field on
the form and modifying it by adding the first part of the address into the
code of the form processor.
it took quite a while and was very frustrating. I was having a flash back
when I read Hugh's first post. ;-)
 
J

Jon Spivey

Hugh
I see whats happened here
request.sessionvariables("HTTP_REFERER")
you want
request.servervariables("HTTP_REFERER")
just for a test you can make up a table with all the server vars
<table>
<tr><td>Name</td><td>Value</td>
<%for each f in request.servervariables%>
<tr><td><%=f%></td><td><%=request.servervariables(f)%></td></tr>
<%next%>
</table>

Jon
 
K

Kevin Spencer

Hi Jon,

I think that was a typo. I saw it, and checked his earlier messages, in
which he used the correct syntax.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Top