IE did not set document.referrer
NickName:Muhammad Imran Tariq Ask DateTime:2012-12-03T18:18:53

IE did not set document.referrer

I observed it closely by debugging in IE that; IE did set document.referrer if I submit form or click any link but when I redirect to another page using javascript window.location, IE did not set document.referrer.

Copyright Notice:Content Author:「Muhammad Imran Tariq」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/13681156/ie-did-not-set-document-referrer

Answers
Anjith K P 2014-03-01T06:29:04

INFO: Internet Explorer Does Not Send Referer Header in Unsecured Situations\n\nWhen linking from one document to another in Internet Explorer 4.0 and later, the Referer header will not be sent when the link is from an HTTPS page to a non-HTTPS page. The Referer header also will not be sent when the link is from a non-HTTP(S) protocol, such as file://, to another page.\n\nMicrosoft",


Jonathan de M. 2012-12-03T10:22:34

Try this\n\n<script type=\"text/javascript\" > \nfunction redirect(url) {\n if (/MSIE (\\d+\\.\\d+);/.test(navigator.userAgent)){\n var referLink = document.createElement('a');\n referLink.href = url;\n document.body.appendChild(referLink);\n referLink.click();\n } else {\n location.href = url;\n }\n}\n</script>\n\n\nsource",


polin 2012-12-03T10:23:26

IE doesn't Support referrer while you try to send it in pop-up or use window.location.You can send your referrer in many ways. But you will not have it if you try to get it in server side if while change location through a JS popup or change location in JS while using IE, for IE built-in security issue. Check window or window.open property.you can go here",


Sachindra Dubey 2013-06-25T15:00:43

The easiest solution is you can use window.opener.location.href, it works fine in all browsers.",


More about “IE did not set document.referrer” related questions

IE did not set document.referrer

I observed it closely by debugging in IE that; IE did set document.referrer if I submit form or click any link but when I redirect to another page using javascript window.location, IE did not set

Show Detail

IE did not set document.referrer

I observed it closely by debugging in IE that; IE did set document.referrer if I submit form or click any link but when I redirect to another page using javascript window.location, IE did not set

Show Detail

document.referrer is empty in IE11

I have a problem with document.referrer in IE. I can see the referer in the request header but document.referrer always give me an empty string. It works in other browser. I have a link pointing to

Show Detail

IE has empty document.referrer after a location.replace

I've got a site that does a complex search and has a "loading" page. On the loading page we use: &lt;body onload="window.location.replace('results_page.php');" &gt; Or: &lt;body on

Show Detail

Is `document.referrer` url-encoded or not?

I wrote a small test page to grab document.referrer of users with javascript and send it to a simple log server (like sendReferrer(document.referrer)). The referrer Firefox sends is always url-enc...

Show Detail

document.referrer not working in safari?

I am using document.referrer to get referrer url in javascript. It is working fine in Mozilla, Chrome and IE but not working in SAFARI. Why ?

Show Detail

On IE 10+, will document.referrer be blank when read inside an iFrame?

On all other recent browsers, reading document.referrer from an app which runs inside an iframe would return the URL of the parent site. On IE 11, however, it seems to be returning an empty string. I

Show Detail

Javascript or jQuery: Is there a way to set document.referrer without changing it every time a page reloads?

I want to be able to send a user back to the URL they came from after looking at a map gallery I'm building. document.referrer would work perfectly except that there are links within my gallery that

Show Detail

Javascript document.referrer empty in IE after redirect

I'm linking to a page (page1) which performs a redirect the final page (page2). But on page 2 the document.referrer property is empty but only in I.E because of the redirect. Is there a way to solve

Show Detail

Problems with document.referrer

I'm having some trouble using document.referrer on some sites, even the reference site using HTTP protocol. In what circumstances document.referrer may be empty (except HTTPS to HTTP)? What is the...

Show Detail