Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does http-equiv="refresh" keep referrer info and metadata?

If I set up a page like this:

<html><head><meta http-equiv="refresh" content="0;url=http://internic.net/"></head><body></body></html>

Will the browser send referrer info and other metadata when the redirection is performed?

like image 993
Kudu Avatar asked Jun 06 '10 19:06

Kudu


People also ask

What does meta HTTP-equiv refresh do?

Meta refresh is a method of instructing a web browser to automatically refresh the current web page or frame after a given time interval, using an HTML meta element with the http-equiv parameter set to " refresh " and a content parameter giving the time interval in seconds.

Which value of HTTP-equiv attribute will refresh the page after specific time?

In HTML and XHTML, one can use the meta element with the value of the http-equiv attribute set to " Refresh " and the value of the content attribute set to "0" (meaning zero seconds), followed by the URI that the browser should request.

What is the use of meta HTTP-equiv?

The http-equiv attribute provides an HTTP header for the information/value of the content attribute. The http-equiv attribute can be used to simulate an HTTP response header.

How do you refresh HTML automatically with the help of meta tags?

Approach 1: One can auto refresh the webpage using the meta tag within the head element of your HTML using the http-equiv property. It is an inbuilt property with HTML 5. One can further add the time period of the refresh using the content attribute within the Meta tag.


2 Answers

In testing here, Firefox and IE do not but Chrome does send the referrer (though this is inconsistent as well), regardless of whether it's going to the same domain or not.

Seeing as I can't find any spec stating what should be the standard behavior, and W3C in general discourages a META redirect, I'm not sure you can ever depend on this being consistent.

like image 145
Nick Craver Avatar answered Sep 17 '22 23:09

Nick Craver


I did some additional testing with this. I had three URIs involved (all on the same domain):

  • /page.html which had a link to the meta refresh
  • /refresh.html which used a meta refresh to the destination
  • /destination.html which used JavaScript to write the referrer into the page.

I ran the test in several browsers by opening page.html and clicking on the link, then observing what the referrer was on the destination. Here are the results:

  • Internet Explorer - No referrer
  • Firefox - No referrer
  • Chrome - Referrer: http://example.com/refresh.html
  • Safari - Referrer: http://example.com/refresh.html
  • Opera - Referrer: http://example.com/refresh.html

None of the browsers showed http://example.com/page.html as the referrer the way that they would with a 301 or 302 redirect. So meta refresh can be used to some extent to obscure the referrer:

  • Hide the specific page that had the link
  • Remove the query string from the referrer
  • If a third party site hosted the refresh, hide the specific site that linked
  • Remove the external referrer on incoming traffic (useful in situations like this)
like image 38
Stephen Ostermiller Avatar answered Sep 21 '22 23:09

Stephen Ostermiller