Assuming the following scenario:
- User is on product list page
- Clicks a product and is redirected to the product detail page
- Clicks on purchase button
POST /products/1/purchase/
is executed and redirects back to product detail page- User clicks back button
POST /products/1/purchase/
is executed again (FAIL! it should have been redirected to product list page)
How would you solve the back button problem? Is there any response code that forces the browser to skip the location from history stack?
Assuming I can implement my own back button, how would you implement it?
- Manually tracking the history, client-side
- Manually tracking the history, server-side
- Setting checkpoints and redirecting back to the checkpoint in case of existence