locked
sESSION EXPIRE RRS feed

  • Question

  • User582566331 posted

    I NEED TO REDIRECT THE PAGE TO SESSION EXPIRE PAGE WHEN CLICK ON BACK BUTTON

    Saturday, April 9, 2016 7:36 AM

Answers

  • User614698185 posted

    Hi sweetyPaul,

    I create the sample for you, like below:

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

    Best Regards,

    Candice Zhou

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, April 15, 2016 8:20 AM

All replies

  • User-1355486065 posted

    You can simply redirect by Using <a href="sessionexpirepage"></a> and make sure you have session expired on pageload or on the click event of the button

    Saturday, April 9, 2016 8:16 AM
  • User582566331 posted

    No.. When click on browser back button session should expire and redirect to the session expire page.

    Saturday, April 9, 2016 8:37 AM
  • User-1355486065 posted

    Check this out

    http://stackoverflow.com/a/21457054/2630817

    Saturday, April 9, 2016 9:18 AM
  • User614698185 posted

    Hi sweetyPaul,

    I create the sample for you, like below:

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

    Best Regards,

    Candice Zhou

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, April 15, 2016 8:20 AM