Reputation: 3922
Let's consider a scenario like below :
What is the best way to avoid back button and re-submissions ?
The controller for this question is the same as here.
Upvotes: 2
Views: 1555
Reputation: 44841
All data changing requests should be done using the POST
method — or PUT
, POST
or DELETE
if you're doing it in the RESTful way. After such a request, redirect to a GET
page. If a user will push the back button, the browser will show a warning saying that the request should be sent again and that it can lead to unwanted results. If the user insists on resending the request, she should get a 404
error page because she's trying to do stuff with something that doesn't exist anymore.
Upvotes: 4