My client’s site has notification feature. With that I mean that whenever something happen, user is redirected to notification.php and notification is showed to him.
For example…
“You are signed-up now! Thanks.”
After few moments he is redirected to the new location. For example, sign-in.php.
Problem comes when user tries to click browser’s back button. he is redirected not to “sign-up.php, but notification… and again redirected.
How to solve this?
For JS redirect I use this…
setTimeout( function() {
window.location.replace( '<?php echo $location; ?>' );
}, 1000 * 3 );
You could use a conditional redirection. When redirection occurs , set a special context variable to false…. and then if the user uses the back, you just have to check the variable