Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Unwanted CGI execution on Refreshing

by MidLifeXis (Monsignor)
on Nov 04, 2011 at 12:55 UTC ( [id://935923]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://935923]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-25 06:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found