[thelist] Referer Headers

Richard Livsey Richard at livsey.org
Fri Jul 16 06:33:51 CDT 2004


Jason Handby wrote:

>I'm pretty sure you don't get a referer header if you use a server-side
>redirect (e.g. Response.Redirect in ASP), or if you use client-side
>javascript to navigate to the page. I think browsers only send a referer
>header when you click on a conventional link. I don't know if there's a
>standard for this though.
>
To flip this thread on its head for a second, how do you *set* the 
referer header before you do a server-side redirect?

I was writing something yesterday which redirects non-logged in users to 
a page and figured it would be nice on the login page to know where they 
came from (so I can redirect them back there on successful logins).
I figured that I should be able to set the referer header prior to the 
Location header but a casual attempt didn't appear to work.

In the end (it was only a quick job so I didn't have time to go deep 
into why the above wasn't working) I just appended the URL to the query 
string to pass it to the login page.

Any ideas if this is possible? A quick google didn't turn up anything of 
use that I could see.

-- 
R.Livsey
Incutio Web Developer
www.livsey.org
www.incutio.com




More information about the thelist mailing list