Git Product home page Git Product logo

bootstrap-session-timeout's People

Contributors

astrapi69 avatar benkiefer avatar brechmos avatar rak-phillip avatar vedraan avatar xibman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bootstrap-session-timeout's Issues

Mobile Popup issue

When the application is running on mobile, the timeout is not triggered if it is not focused on that tab or if the mobile is closed.

keepAliveUrl fired at start

1 Why keepAliveUrl url is loaded in all page refresh ? session is automatically extended after page refresh so i want only run this url if user nor refresh page,
2 why if i setup keepAlive: false and put keepAliveUrl message modal dont have this url. I want dont exdend session automaticly but add possible for button.

Change the dialog title tag to H2

H4 doesn't complain with WCAG standards. When I changed it to H2, it looks bigger, but it passes WCAG requirements.

Alternative solution might be to add the aria-level=2 attribute to the header tag.

How to update redirAfter and warnAfter values.

I am extending session expiry time from back-end and want to reload the redirAfter and warnAfter values for session timeout. Currently, I do not want to reload the page however I have initiated $.sessionTimeout post-session extending and I can see browser cookies are set to new expiry however redirAfter and warnAfter values are still set to old values. How to update these values [redirAfter and warnAfter].

Bower Component

Would you mind registering this as a bower component? I'm happy to put together the needed changes for you if that would help. Thanks!

Option "redirAfter" must be equal or greater than "warnAfter".

Hi Currently my settings is:

$.sessionTimeout({
            title:'Idle Timeout',
            keepAlive:false,
            logoutUrl: '../user/logoff.html',
            redirUrl: '../user/logoff.html',
            warnAfter: 900000,
            redirAfter: 60000,
            countdownMessage: 'Redirecting in {timer} seconds.',
            countdownBar: true
        });

I want the modal to appear after 20 mins of idle, then countdown from 60 secs. It doesn't make sense the redirAfter has to be greater.

URL with query string

Hi, first off thank you for this great plugin. It was quick and easy to set up. I have found an issue though. For my redirect url I was hoping to put a query string simply to trigger an alert on the redirect page.
For example:
redirUrl: "alert.php?action=logout"

However if ?action=logout is added to the redirect it does not redirect to the correct page. It appears to always redirect to the logoutUrl: Even if I add it to the logoutUrl it is never added. Not a huge deal but just wanted to see if I'm missing something. Thanks!

Set focus on window after popup.

The popup doesn't change the focus to the modal popup, it remains on what ever element you had originally set the focus. I can't figure out if there is some way to actually set the focus to one of buttons in the modal popup.

Remove boostrap dependency

Wish to know if this plugin can works fine without bootstrap. Is there a way in this plugin to invoke another css framework for the modal like materialize css or foundation css

Mobile - The redirection function not working when the page is running in a background browser tab

Hi all,

I set the session timeout interval to 5 mins, the warning message will be shown at 3 minutes and the page will be redirecting at 3:30 to maintain the session. (so the session is never expired unless I close the browser)

And I got an issue on mobile when I go to the page, then open another browser tab, visit another web site and stay there for more than 5 minutes (session timeout interval: 5 mins). Then I go back to the browser tab running the page and see that the warning message is still there, the page was not redirected. And the session is expired.

Is it an issue? How can I get the page redirected at 3:30 to maintain the session as usual?

Time Remaining

Any chance you might add in time remaining? I'm not sure how it would work under the current setup, but it might be nice!

You could alternatively add a progress bar going from 100% > 0% based on the timout time - warning time.

Thanks for the plugin!

s suffix at {timer}

I believe there is not need to add the 's' suffix at the {time} string, because of internationalization.

's' is only valid in Latin based languages (English, French, Spanish, Italian etc), but it's not valid for other languages such as Greek, Arabic, Chinese, Cyrillic languages etc.

A developer can add his own 'seconds' indicator at the countdownMessage (ex. 'Redirecting in {timer}s')

User Activity closes the Warning window

Hello there,
I use the session timeout library with these settings:
$.sessionTimeout({
keepAlive: false,
logoutUrl: '/logout',
redirUrl: '/logout',
warnAfter: 300000,
redirAfter: 330000,
countdownMessage: 'Redirecting in {timer} seconds.'
});
The problem I experience is that after the warning is shown to the user, the modal is closed after mouse move. I expect the modal to stay open until the timer expires or the user click on one of two buttons: Stay Conntected or Logout.

Thanks, Blerim

Timer stop after Redir

The timer should stop after onRedir function has finished execution. Effectively when the whole sessionTimeout cycle has finished once.

The problem is, in our application, we show lock screen modal on the same page, and not redirect user to lock screen page. Now, what happens is, the timer keeps running and shows session timeout warning again.

Check IE11 issue reported by agwanti

First of all, many thanks to author, this is a great script

I have made some small modification to bootstrap-session-timeout.js script:
(remaining time countdown display [in seconds]; IE11 modal display(not displaing) bug; useractivity event timer reset)

  1. add timer_c var:
    var opt = defaults,timer,timer_c;
  2. clear timer_c timer (inside startSessionTimer function, first line)
    clearTimeout(timer);
    clearTimeout(timer_c);
  3. initialize counter (inside startDialogTimer function, last line)
    var counter=(opt.redirAfter - opt.warnAfter)/1000;
    timer_c = setInterval(function(){
    counter -= 1;
    $("#sessionTimeout-dialog-keepalive #counter").html('['+counter+']');
    }, 1000);

where #counter is a span with id counter inside keep-alive button (or anywhere you like inside modal div) wich will show remaining seconds until logout

optional (for bootstrap modal IE (11) compatibility, remove "fade" class from parent modal div)
finaly, i have changed events that trigger timer reset on user activity
"keyup mouseup scroll touchend touchmove" - removed mousemove and added scroll, so timer will not be reset (especially when modal is launched) on mousemove event

hope this will help for next script release

.isShown does not exist

The following property checked in the mouse move event does not exist:
$('#session-timeout-dialog').data('bs.modal').isShown

The following does exist however:
$('#session-timeout-dialog').data('bs.modal')._isShown

Is this intended?

reset timeout

Hi,
is there a way to reset the timout?..
I do ajax calls that do not refrsh the entire HTML page, so the timeout keep running..
I would like to call a function (ex : jQuery.sessionTimeout.resetTime() ) after my ajax call that start the countdown again
thanks!

'use strict' outside of the IIFE causing other scripts not using strict to stop working

Hi,

First, Thanks for your great script.

I was facing a problem where my site was not working after I deployed. I was getting an error resulting in the use of "use strict" and JavaScript "with". The "with" keyword is being used in another JavaScript library. I realized that the "use strict" statement in bootstrap-session-timeout was outside of the IIFE function and thus made "use strict" global. I fixed this issue by modifying the script to put the "use script" statement just inside the function.

Please consider updating your repository, so that your script can play well with other scripts that may still be using deprecated JavaScript code.

I will also suggest to the authors of the other library to remove the "with" statement.

Thanks.

How to update the timer with the remaining seconds before timeout

First, I want to thanks you a lot for this script. it is awesome!

I do have an issue or it could be just something that I am missing.

Here is how my site log in works, when a user logs in, I create a session ID using PHP and I store it in a cookies. Then each time a user refresh the site "from any browser's tab" I reset their expiration time by adding 15 more minutes. this basically adds 900 seconds to the idle timeout stored in the session.

Now, my question is how will I be able to use this script to make a call to a page that tells me how many seconds are remaining before the session times out?

I have a PHP script that returns the total second left before the server times you out so I want to check that script every 10 seconds or so to get a reading on how much time renaming before timing out or display the warning message.

The reason I would need this is because some users my be idle on one browser's tab but active on another tab. So as long and the user is refreshing the site from any tab I want to keep them alive and I don't want one tab to time them out since they are still working.

thank you for your help

Keep Alive Not Running

Hi,
Thanks for the excellent plugin. Keep alive does not seem to run even though these options were set:
keepAlive: true,
keepAliveInterval: 10000,

Adding a call to keepAlive() in the timeout function solved the problem:

function keepAlive() {
            if (!keepAlivePinged) {
                // Ping keepalive URL using (if provided) data and type from options
                $.ajax({
                    type: opt.ajaxType,
                    url: opt.keepAliveUrl,
                    data: opt.ajaxData
                });
                keepAlivePinged = true;
                setTimeout(function() {
                    keepAlivePinged = false;
            keepAlive(); // <-- added this line
                }, opt.keepAliveInterval);
            }
        }

TypeError: $(...).data(...) is undefined

There is an error found by firebug.
TypeError: $(...).data(...) is undefined
bootstr...eout.js (line 103, col 20)

related statement:
$('#session-timeout-dialog').data('bs.modal').isShown

Maybe add
&& typeof $('#session-timeout-dialog').data('bs.modal') !== 'undefined' ?

Ability to check connection (check response status)

Hi! Just a feature suggestion:
Add a callback to control server response to the ajax call. For example, we could check status and display warning "Server is unaivailable" or something like this. Now we just sending requests and don't receive any feedback from the server

stay connected & keep alive

hi! i think it is not ok:
IF:

  1. keepalive pinged on mose actions.

     ignoreUserActivity: true
    
  2. keep alive on every page reload at - So i set keepAlive: false;

    startSessionTimer(). (if (opt.keepAlive) {keepAlive();} 
    

Result
Then i click stay connected then server are not pinged. in reality user could click sty connected but not click reload page.

workaround: remove pinging on every page reload or add this two options at button click sty connected.

$('#session-timeout-dialog').on('hide.bs.modal', function() {
            // Restart session timer
            startSessionTimer();
            //this keepAlived on stay connected
            if (opt.keepAlive===false) {
                    keepAlivePinged = false;
                    keepAlive()
             }
        });

Missing files

Call me out if I am wrong, but you mention that this build requires bootstrap.js and bootstrap.css. Where are they located?

Where is bootstrap.css?

Hi, just wondering where I could find the bootstrap.css file? It's not in the distribution file.

Thanks

Any support for multi-tabbing?

Hello,

I wonder if this library has any support for multi-tabbing? I've been using BootStrap Session Timeout and it works wonderfully, but I've come to this issue:

If I have more than one tab open, each tab has its own timeout fired. So, let's say I'm working with 3 tabs, and my timeout is set to 5 minutes. If I'm working with tab#3 and haven't opened tab#1 or tab#2 in 5 minutes, my application logout function is fired, and therefore I lose whatever work I do in tab#3.

I wonder if we have anything right now to deal with that? For example, something to communicate with localStorage timer wise?

KeepAliveButton does not submit

Just testing out this plugin, I'd like for the KeepAliveButton to post to the keeAliveUrl.
This way if I have keepAlive set to false, if the user chooses to stay logged in, it will post to the keepAliveUrl and keep the user logged in as well as reset the timer.

My server side sessions expire after XX amount of time, I have the warnAfter set a little before and the redirAfter set a little after.

If a user has mouse movements or keyboard activity, I'd like to send keepalive requests, if the user is idle, I don't want keep alive requests sent. The keepAlive request will reset the server side session timer as well as the one defined by this plugin.

If I'm missing something, please correct me. Otherwise I'd love to see these improvements made.

reDir after timeout resets when user moves mouse

I have things configured to show a timeout progress bar with warnAFter set to 60000 and redirAfter set to 120000 (low values for testing).

The dialog appears correctly and the progress bar starts counting down form 60 seconds but as soon as I move the mouse, the progress bar resets to 120 seconds and starts counting down again.

Not a huge deal since there must be someone there if the mouse moves but wanted to let you know.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.