How to stop the browser from going back to viewed pages after logout action?

I have Logout Link in the home page and on clicking that link I am redirecting user to the login page.

When user click on back in browser it redirecting to home page after loutout.

How to stop this.

I have tried using javascript code at the header of login page.

<script type="text/javascript">
            function noBack() { window.history.forward() }
            noBack();
            window.onload = noBack;
            window.onpageshow = function (evt) { if (evt.persisted) noBack() }
            window.onunload = function () { void (0) }
</script>

Help me out here.

Answers:

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.