Discussion Locked

Internet

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Using the new Netscape browser(6.1), the HTTP_REFERER variable appears to have been cleared. Is there a way to cancel this behaviour or a decent work around so I can keep the info the variable supplies?

2 replies

by jay eckles

Unfortunately, HTTP_REFERER is an optional header for the user agent to send, and at the server you're limited to the information that the client provides in its request. If the agent does't send an HTTP_REFERRER, then there's not much you can do about it.

If you're looking to use the referer to do something like track the path of a user through your site, you could program around the problem using cookies...each page will need to look for cookies and then make a note on the server of the referer, then reset the referer cookie to the current URL. You could do this with a bit of Javascript and a little server-side scripting.

If you're trying to tell what site is linking to yours, you might give out a different link to each search engine, index, etc. that you submit your site to: for example, http://www.jayeckles.com/cgi-bin/enter.cgi?referer=google
Might do nothing more than log the fact that a user came from a link I submitted to Google and then redirect them to the homepage.

I guess your specific needs will determine the workaround you use, if any.

Good luck.

Jay Eckles
www.jayeckles.com

by m_baekdal

I have figured that there is no way of stopping the clients browser from changing server variables, so I've implemented a workaround by hardcoding a variable within the server-side script that the user will be redirected to if my page fails. I wouldn't really expect to be able to do anything else, however if someone does have a slicker way of doing this - I'm all ears. ps Already implemented this work around.

This discussion is closed to new replies.