1

I am using Timeout Dialouge plugin in asp.net MVC web app from https://github.com/rigoneri/timeout-dialog.js for showing a session timeout popup countdown.

In my layout page I have following JS call:

 @if (User.Identity.IsAuthenticated)
 {
    <script type="text/javascript">
        $(document).ready(function () { $.timeoutDialog({ timeout: 1200, countdown: 60, logout_redirect_url:'../Account/LogOff', restart_on_yes: false }); });
    </script>
 }

Notice the "logout_redirect_url:'../Account/LogOff'" part, Account is Controller & LogOff is Action. The countdown timer shows as expected but it does not redirects to LogOff action and reloads the active page again.

Am I doing something wrong here?

1 Answer 1

1

This plugin is 5 years old and no more maintained.

The problem you are experiencing is with the jQuery libraries: if you use the libraries available when this plugin was developed it works well:

$(function () {
  $.timeoutDialog({
    timeout: 1,
    countdown: 5,
    logout_redirect_url: '../Account/LogOff',
    restart_on_yes: false
  });
});
<link rel="stylesheet" href="https://rawgit.com/rigoneri/timeout-dialog.js/master/css/timeout-dialog.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/jquery-ui.min.js"></script>
<script src="https://rawgit.com/rigoneri/timeout-dialog.js/master/js/timeout-dialog.js"></script>

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.