Logout issue : when user presses browser back button, previous screen displays

If user is logged out from the application and clicks on back button of browser then it navigating back to page where it showing home page of application. It should show login page.

SANDEEP KUMAR wrote:

If user is logged out from the application and clicks on back button of browser then it navigating back to page where it showing home page of application. It should show login page.



Hi SANDEEP KUMAR,

You can block the browser back button, or clear the browser cache when user does logout.

Block back button:

$().ready(function() {
    if(document.referrer != 'https://localhost:8181/'){ 
        history.pushState(null, null, 'login');
        window.addEventListener('popstate', function () {
            history.pushState(null, null, 'login');
        });
    }
});

Or clear browser cache:

<META Http-Equiv="Cache-Control" Content="no-cache">
<META Http-Equiv="Pragma" Content="no-cache">
<META Http-Equiv="Expires" Content="0">

Thanks,

Assif