Jad Chahine
Jad Chahine

Reputation: 7149

How can i disable the browser’s back functionality after logout in asp.net?

I want to disable the browser's back button after log out.

I have already set session ["session-id"] to null on log out event.

But when I am pressing back button of the browser :

It will redirect me to that secure page from which I've already log out.

Please Give me any solution about this problem

Upvotes: 0

Views: 1891

Answers (1)

Sankar
Sankar

Reputation: 7107

The below Javascript code may help you...

<script type = "text/javascript" > 
    function preventBack(){window.history.forward();} 
    setTimeout("preventBack()", 0); 
    window.onunload=function(){null}; 
    </script>

use the code in a page where you don't want to go back...

Upvotes: 3

Related Questions