• I have a WordPress website.

    The security team tested my website as well as the admin panel of WordPress.

    They have found one issue, that I am sharing here.. Below is the steps that they have followed

    1. Login in the WordPress admin panel

    2. Logout from the WordPress admin panel

    3. Now they have clicked on the back button of the browser and it’s showing the dashboard of the wp-admin.

    If they click on any of the links then it will redirect to 404 because the session and cookies expired after logout.. which is correct according to me

    Now security team says, Once the user clicks on the back button of the browser then it should be redirected to 404 or the login page. I have tried the below code, If press the back button after logout then it will wait for 2-3 sec and redirect to the 404 page.

    <script type="text/javascript">        window.onunload = function(){};        if (window.performance && window.performance.navigation.type === window.performance.navigation.TYPE_BACK_FORWARD) {            location.reload();        }        window.onpageshow = function(event) {        if (event.persisted) {            window.location.reload()         }    };    </script>

    The above code is tested and working but the security team says, it’s taking 2-3 sec time to redirect, and this is the issue

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Browser Back button talking 2-3 second time to redirect to the page’ is closed to new replies.