Redirect After Post (PRG Pattern)
Avoid duplicate submissions with a redirect.
The Double Submit Problem
After a form post, hitting refresh resends the same data. That can create duplicate orders, comments, or signups. 😬
Why Refresh Repeats
The browser remembers the last request. Reloading a page that was the result of a POST simply fires that POST again.
All lessons in this course
- Build an HTML Form That Posts
- Read and Default Query Parameters
- Validate Required Fields by Hand
- Redirect After Post (PRG Pattern)