On Sat, Jun 27, 2020 at 7:31 PM Craig Russell <apache....@gmail.com> wrote: > > After sending the POST message, coi.cgi still thinks that reloading the page > should re-send the POST and displays the message "Are you sure you want to > send a form again?" How do we reset this so that reloading the page is a GET?
First some links: https://en.wikipedia.org/wiki/Post/Redirect/Get https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/303 https://github.com/apache/whimsy/blob/18f24fb1b5dacf2b523f5ba233fdb5a847a35a0e/www/members/security-subs.cgi#L24 What's happening now is that 1) Somebody clicks on a link or pastes a URL into the browser window. 2) Your CGI script is run, and produces some HTML 3) The browser renders the HTML 4) The pushes a button and a POST request is sent to the server 5) Your CGI script is run again, does some stuff, and produces some HTML 6) The browser renders the HTML If, at this point, the user presses refresh, it will resubmit the post. To correct this, we need to replace step 5 with: 5a) The CGI script is run again, does some stuff, and sends a HTTP 303 "See Other" response along with a location 5b) The browser issues a HTTP GET 5c) Your CGI script is run again, and produces some HTML If, at this point, the user presses refresh, it will resubmit the get. An example of sending a status back can be found in the 3rd link above. > There is a similar problem with the POST from the Member Status change. Once > the POST has been accepted, the memstat menu disappears but the cursor still > shows a STOP (/) symbol. If the cursor is moved the symbol disappears but I'd > like the code to remove the symbol. Probably something in memstat.json.rb but > I modeled a similar bit of code in other ...json.rb files. > > Any ideas? > > Thanks, > Craig > > Craig L Russell > c...@apache.org - Sam Ruby