0

https://github.com/orangehill/bootstrap-session-timeout There is the jquery plugin we use with such initialization in the _Layout.cshtml

 $(document).ready(function () {
                $.sessionTimeout({
                    keepAliveUrl: '/Account/KeepSessionAlive/',
                    logoutUrl: '/Account/LogOff/',
                    redirUrl: '/Account/SessionExpired/',
                    ignoreUserActivity: true,
                    warnAfter: 700000,
                    redirAfter: 720000,
                    countdownBar: true,
                    keepAliveInterval: 1000000
                });
            });  

So, we don't pay attention to user activity and popup appears always in the same time. But now, we have 3rd party thing (line online chat in the separate window). So if user only chatting, timer ends and bootstrap popup shown. The task is not only to send ping to KeepSessionAlive method of the controller, but also to reset timer inside the session timeout plugin.

For example plugin's popup appears on 11min30sec if do not touch anything. If for example on the 2 minute i update the timer and post ping, then popup should appear on 13min30sec.

Here is event listener from that 3rd party chat:

window.addEventListener('message', function (event) {
                    // Ping server and update timer here
                });

Please suggest the solutions. Thank you

Alexander
  • 431
  • 2
  • 5
  • 19

1 Answers1

0

Fixed that with event handling How to trigger event in JavaScript?

But would be nice to hear another solutions, because spent almost the whole day with this :(

Alexander
  • 431
  • 2
  • 5
  • 19