Clicking the browser back button after logout

If we ‘logout’ from our customer portal, we are redirected to the ‘login’ page; then if the user clicks the ‘back’ button – we are then still able to see the cached previous page.


We do not want to disable the back button, and we also do not want to be able to see the previous page after logout, especially if a different user happens to continue on the same browser session and goes 'back' to see the previous details. And, we do not want to disable the cache, only on logout action if possible.


This only happens on Internet Explorer. In Chrome, and Edge, I am redirected to a ‘no permissions Login’ page – which is what we would like to happen every time we logout.


None of these browsers go back through the preparation, and it is only Internet Explorer where we are able to see a cached page.


Any helpful suggestions would be great!

We are using OutSystems platform 10.


Thanks! :) 

Hello Ebony, 

have you tried to use this component? I think it might solve your problem. 

https://www.outsystems.com/forge/component-overview/2932/browsers-back-button-protection

Best Regards

Paulo Zacarias wrote:

Hello Ebony, 

have you tried to use this component? I think it might solve your problem. 

https://www.outsystems.com/forge/component-overview/2932/browsers-back-button-protection

Best Regards

Thank you for your quick response! :) 


We were able to try this, and by doing this, we are still able to see the page quickly before it is forced to run the preparation...which we do not want, as this could create a security risk.


Thanks again

Well, 

a workaround you can do is to redirect the user to a 'pre-logout' screen (remain there for a few seconds) before you send him to the Login page. In this 'pre-logout' screen use that component. Maybe that will do the trick.

Best Regards

This does not stop the user from clicking the back button more than once, or ‘right clicking’ on the back button, and landing back on the other previous pages.


This only happens with Internet Explorer, and we have been working on it for a while now and have not come to a solution.


But again, thank you for your suggestion, anything helps!

Solution

We have implemented some JavaScript on pages where we are wanting to re-run the preparation, using an expression on the screen, to detect if the back button has been pressed and force the preparation to reload and navigate users away if they are not logged in:

"<script>
   if(!!window.performance && window.performance.navigation.type === 2){
       console.log('Reloading');
    window.location.reload();
}</script>"

Hopefully this can help anyone else having the same issues.

Solution