in reply to Unwanted CGI execution on Refreshing

The first response is right on the money.

A URL is a handle to some asset accessible from your web site. When you want to modify it, you should be using POST, PUT, or DELETE. GET requests should not modify the asset.

What I typically do is to use POST (when possible, I use PUT and DELETE in a REST methodology), and my response to the POST is a redirect to the GET for the object just modified.

--MidLifeXis

  • Comment on Re: Unwanted CGI execution on Refreshing

Replies are listed 'Best First'.
Re^2: Unwanted CGI execution on Refreshing
by admiral_grinder (Pilgrim) on Nov 07, 2011 at 17:41 UTC
    I agree here, server side redirect is the best way to go. I know this works well for Firefox and Webkit browsers. The browser will not keep the "post" url in its history after a redirect so you can then hit the back and forward buttons all day long. With CGI::Application it only takes less 10 lines with generous whitespace.