Logo

Session Timeout Demo

After a set amount of time(10 seconds set for demo), a dialog is shown to the user with the option to either log out now, or stay connected. If log out now is selected, the page is redirected to a logout URL. If stay connected is selected, a keep-alive URL is requested through AJAX. If no options is selected after another set amount of time, the page is automatically redirected to a timeout URL.


            var KTSessionTimeoutDemo = function() {
                var initDemo = function() {
                    $.sessionTimeout({
                        title: "Session Timeout Notification",
                        message: "Your session is about to expire.",
                        keepAliveUrl: "HOST_URL + "/api/session-timeout/keepalive.php",
                        redirUrl: "#",
                        logoutUrl: "#",
                        warnAfter: 3000, //warn after 5 seconds
                        redirAfter: 35000, //redirect after 10 secons,
                        ignoreUserActivity: true,
                        countdownMessage: "Redirecting in {timer} seconds.",
                        countdownBar: true
                    });
                }

                return {
                    //main function to initiate the module
                    init: function() {
                        initDemo();
                    }
                };
            }();

            jQuery(document).ready(function() {
                KTSessionTimeoutDemo.init();
            });
            

Select A Demo

Demo 1
Demo 2
Demo 3
Demo 4
Demo 5
Demo 6
Demo 7
Demo 8
Demo 9
Demo 10
Demo 11
Demo 12
Demo 13
Demo 14
Demo 15
Demo 16
Demo 17
Demo 18
Demo 19
Demo 20
Demo 21
Demo 22
Demo 23
Demo 24
Demo 25
Demo 26
Demo 27
Demo 28
Demo 29
Demo 30