Page 1 of 1

Update referer on redirect

Posted: Wed Sep 26, 2007 6:12 am
by jamiel
Hi all,

I am trying to do a redirect from one page to another but I want the final page to know where the redirect came from. However the default behavious (on Firefox and Opera at least) seems to keep the original page as the referer.

I have tried a meta refresh, a Location header and a javascript document.location but the browser still insists on keeping the original page as the referer rather than the page it got redirected from.

Does anyone know a way around this?

Thanks alot

Jamie

Posted: Wed Sep 26, 2007 7:21 am
by superdezign
Well, what you are doing isn't really "redirection," but rather "replacement." You could use sessions and save the current page prior to sending the new 'Location' header, as I do.

Posted: Wed Sep 26, 2007 7:49 am
by jamiel
Unfortunately this is not ideal as I am redirecting to a 3rd party site.

Posted: Wed Sep 26, 2007 9:42 am
by jamiel
For anyone interested, I have managed to "hack" around this by including an empty form with the action being my redirect page and doing a document.getElementById('myform').submit();