Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This will happen in IE if there's a directive that forbids caching on the post-redirection page. If you remove the No-Cache header, you will find that the problem no longer repros.</p> <p>Here's a <a href="http://www.fiddler2.com/meddler/" rel="nofollow noreferrer">Meddler script</a> that demonstrates the behavior:</p> <pre><code>import Meddler; import System; import System.Net.Sockets; import System.Windows.Forms; class Handlers { static function OnConnection(oSession: Session) { if (oSession.ReadRequest()) { var oHeaders: ResponseHeaders = new ResponseHeaders(); oHeaders["Connection"] = "close"; if (oSession.urlContains("postRedir.asp")) { oHeaders.Status = "200 OK"; oHeaders["Content-Type"] = "text/html"; oHeaders["Cache-Control"] = "no-cache"; oSession.WriteString(oHeaders); oSession.WriteString(""); oSession.WriteString("Top of page&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;"); oSession.WriteString("&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id='firstAnchor'&gt;Div with ID firstAnchor&lt;/div&gt;Click this link: &lt;A href='#secondAnchor'&gt;#secondAnchor&lt;/A&gt;"); oSession.WriteString("&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;"); oSession.WriteString("&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id='secondAnchor'&gt;Div with ID secondAnchor&lt;/a&gt;"); } else if (oSession.urlContains("doRedir.asp")) { oHeaders.Status = "301 Redir"; oHeaders["Location"] = "/postRedir.asp#firstAnchor"; oSession.WriteString(oHeaders.ToString()); } else { oHeaders.Status = "200 OK"; oHeaders["Content-Type"] = "text/html"; oSession.WriteString(oHeaders); oSession.WriteString("This is a test case for http://stackoverflow.com/questions/1985056/response-redirect-with-a-fragment-identifier-causes-unexpected-refresh-when-later&lt;BR/&gt;"); oSession.WriteString("Click this link: &lt;A href='doRedir.asp'&gt;Do Redirect&lt;/A&gt;"); oSession.WriteString("&lt;form action='doRedir.asp' method='post'&gt;&lt;input type=submit value='Submit as form' /&gt;&lt;/form&gt;"); } } oSession.CloseSocket(); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload