Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6548173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:55:10+00:00 2026-05-25T11:55:10+00:00

Consider the following code; it’s basically a form that sends some data via HTTP

  • 0

Consider the following code; it’s basically a form that sends some data via HTTP POST. When the POST data come, the Refresh HTTP header is sent.

<?php
if (!empty($_POST))
{
    header("Refresh: 5; URL=http://$_SERVER[SERVER_NAME]$_SERVER[REQUEST_URI]");
}
?>
<!doctype html>
<form method=post>
    <input type=hidden name=foo value=bar>
    <input type=submit>
</form>
<?php
echo "The location was requested using the HTTP $_SERVER[REQUEST_METHOD] method; \$_POST = ".var_export($_POST, 1);
?>

Now, do this:

  1. Open it in Firefox browser (I’ve created a demo here; I use 6.0.1 on Debian).
  2. Submit the form. Obviously, the browser performed an HTTP POST request. Note that the Refresh HTTP header came with the response.
  3. Wait for 5 seconds. Now the Refresh header is being applied and the location will be redirected to itself.
  4. Firefox performed a GET request. It is definitely GET because both Firebug and PHP’s $_SERVER['REQUEST_METHOD'] say it.
  5. Press F5 key. Since the last performed HTTP request was a GET request, one would expect that all POST data from previous requests will be lost. However, a dialog box appears and asks me to resend POST data:

To display this page, Iceweasel must send information that will repeat any action (such as a search or order confirmation) that was performed earlier.

So, my question is – why are the POST data still here? Is this a bug or intended behaviour?
Note that use of any of the following will cause the loss of POST data (the expected behaviour):

  • Location header instead of Refresh
  • Different value of URL= parameter of Refresh header (the user will be redirected to another location).
  • Another browser (I’ve tested Internet Explorer 9.0.2 and Chromium 6.0).
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:55:11+00:00Added an answer on May 25, 2026 at 11:55 am

    This is neither a bug, nor intended behaviour. The reason for this is that there is no header called Refresh: defined by any of the HTTP RFCs (most notably RFC1945 and RFC2616 make no mention of it). This means that, while most browsers do implement the Refresh header as if it were a meta refresh, there is no expected behaviour for this that can be assumed to be the same across all browsers.

    Looking around StackOverflow and the internet in general it seems that the Refresh: header was (like so many things) invented by Netscape in the early days of the internet and adopted by everybody. While many of these arbitrary Netscape designs (such as Javascript) were later adopted as industry standards, the Refresh: header was not, because HTTP already made provision for this functionality with 3xx response codes.

    The long of the short of this is that it is hardly surprising that different browsers handle it differently, because there is no standard that tells the developers of the browsers exactly how to handle it. And about using the header in your applications – don’t. Plain and simple. Use 3xx redirects. That’s what they’re for. And if you are using it because you need to refresh the page after a timeout, use a <meta> refresh – while this is now officially deprecated it should be handled the same way everywhere.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following code: client.Send(data, data.Length, endpoint); byte[] response = client.Receive(ref endpoint); While, according
Consider the following code and its output: Code #!/usr/bin/perl -w use strict; use Data::Dumper;
Consider following SWT code example: http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet151.java?view=co How can I separate the inline defined class?
Consider following code : <p style=margin: 30px 0; padding: 0;>Some text some text some
Consider the following code snippet that takes user input (a date) and format it
Consider the following code: ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:[NSURL URLWithString:@http://192.168.2.71:3000/ios_file?filename=complaint&folder=encounters&id=3]]; NSString *mediaPath = [NSHomeDirectory()
Consider the following code Snippet Form form2 = new Form(); test(form2); form2.Show(); public void
Consider the following code: $(a).attr(disabled, disabled); In IE and FF, this will make anchors
Consider the following code: void Handler(object o, EventArgs e) { // I swear o
Consider the following code: abstract class SomeClassX<T> { // blah } class SomeClassY: SomeClassX<int>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.