Is it possible to detect when the user clicks on the browser\'s back button?
I have an Ajax application and if I can detect when the user clicks on the back button I
I set a variable $wasPosted in $_SESSION with value false.
$wasPosted
$_SESSION
false
All my posts go via the same php file, and set $wasPosted to true.
true
All header(location:) requests are preceded by setting $wasPosted to true.
header(location:)
If $wasPosted is false then the page was loaded after use of the backward or forward buttons.