65.9K
CodeProject is changing. Read more.
Home

Regarding back button after signout

starIconstarIconstarIcon
emptyStarIcon
starIcon
emptyStarIcon

3.17/5 (6 votes)

Nov 14, 2011

CPOL
viewsIcon

21810

Regarding back button after signout

In your webpage after signout and pressed back button, the previous session will remain the same. So use the below JavaScript. So that previous session will open.

For example: In our CodeProject.com after signout press back button .. your previous session will remain the same.

<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>