0

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
knoopx
  • 17,089
  • 7
  • 36
  • 41

1 Answers1

0

See:

Back button re-submit form data ($_POST)

Community
  • 1
  • 1
ʍǝɥʇɐɯ
  • 4,012
  • 7
  • 32
  • 53