jillelaine / jquery-idletimeout Goto Github PK
View Code? Open in Web Editor NEWThis project forked from josebalius/jquery-idletimeout
Idle activity timeout and logout redirect for jQuery for multiple windows & tabs
License: Other
This project forked from josebalius/jquery-idletimeout
Idle activity timeout and logout redirect for jQuery for multiple windows & tabs
License: Other
Please consider adding the requisite 508/aria markup to your great plugin. The addition of the role and alert nag would make this plugin usable by many more businesses whose sites must be ADA compliant.
Bug: When warning dialog box appears, 'active' window or tab will not stop countdown to logout if user clicks to 'inactive' window or tab and clicks 'Stay Logged In' on that dialog box.
Is there anyway to account for activity in an iframe in the same domain? We use it to display older aspx/asp content in our MVC site.
Original issue was filed by user RAD-X under incorrect fork of this script: josebalius#5 (comment)
RAD-X: "If I use $.fn.idleTimeout().logout(); in logout link, then href action is faster than script. So the user isn't never logged off and logout page keeps reloading.
In your example probably works only because you use "target="_blank" or something similar.
Suggested fix: Add a "return false;" or something similar into fn logoutUser."
Microsoft's implementation of 'web storage' on Internet Explorer 8 is buggy. http://msdn.microsoft.com/en-us/library/ie/bg142799%28v=vs.85%29.aspx
http://msdn.microsoft.com/en-us/library/ie/cc197059%28v=vs.85%29.aspx
This sort of works...but it seems to fire twice for every 'onstorage' event.
document.attachEvent('onstorage', storage_event_reactor); //IE v8
Hi Jil,
I am trying to use this plugin within my site, I have 3 sub-domains within same domain and we use mcp within these for session affinity.
https://qa.bnymellonwealthmanagement.com
https://qa-reports.bnymellonwealthmanagement.com
https://apps-qa.bnymellonwealthmanagement.com
I opened a page hosted on https://apps-qa.bnymellonwealthmanagement.com from https://qa.bnymellonwealthmanagement.com domain but idle timeout popup is only coming on https://qa.bnymellonwealthmanagement.com. Its not coming on https://apps-qa.bnymellonwealthmanagement.com/..
My use case is if I am working on https://apps-qa.bnymellonwealthmanagement.com page on new browser or tab, page at https://qa.bnymellonwealthmanagement.com timesout and open idle timeout pop but same is not getting reflected on https://apps-qa.bnymellonwealthmanagement.com page and I am getting timed out even I am active on https://apps-qa.bnymellonwealthmanagement.com. Please help.
Also what I need to do to customize (text, font, color) warning dialog box?
Appreciate your help.
The idletimeout plugins sends the KeepAlive request at regular intervals. There comes a time when the application will return a HTTP 403 (Forbidden) because the user session no longer authenticates (for whatever permission reasons).
I want to handle the 403 error to log out the user. How do I do this?
(n.b. I have the timeout working properly when the session is about to timeout but sometimes the session is bumped out, either because the application is restarted or otherwise).
Hi All,
I use JQuery-idleTimeOut.min.js for stay In and logout functionality.I have Multiple sub domains for parent domain. i.e main domain like a1.advantmed.com and sub domain like a2.advantmed.com,a3.advantmed.com,etc.I see the iframe demo for cross domain of JillElaine but our organization prohibited the use of iframe. so just little bit change I have done in this jquery. I am use this jquery plugIn and use cookie for get and set value instead of local storage.
But Now one problem arise. "Stay In
" button Is work properly for multiple tabs.Even When idleTimeLimit time complete and simply logout from all tabs working fine.But when click on "Logout
" button of dialog box only one tab in which click button is redirect to log out url but in Other tabs not redirect or no any action performed.
I have attached here updated code in this jquery plugIn.
Please help to find out the actual problem.
Thanks in Advance
You can see this on the example(http://jillelaine.github.io/jquery-idleTimeout/). You open 2 tabs or windows and they do not communicate (notice the screenshot and the time remaining being so far apart). If you press "stay logged in", only one tab dismisses the window.
The code is able to write to the "store" however it is as if it is using 2 different stores, 2 separate session id's or something along those lines. This works fine on Edge, Firefox and Chrome.
Does anyone know the solution?
Hi,
First of all, great plugin. However, I'm encountering intermittent issues such that my session timeout is set to 30 minutes, I set the idleTimeActivity to 27 minutes and the countdown timer to 3 minutes. When the timer shows up in 27 minutes in, I wait for the countdown timer to count until less than 5 seconds, and clicks on Stay Logged In button. Sometimes, the session is gone but sometimes it remains.
Any idea why this happens? Is it because ASP.NET's session expires sooner?
Thank you. Any help would be greatly appreciated!
Session Time out dialog box doesn't disappear when explicitly clicked on Logout button and count shows NAN after 0.
I've noticed that on other peoples implementation of this code, the KeepAlive is ONLY triggered in regular intervals while there is activity. Be it keyboard, mouse etc. This implementation looks to simply call the keepalive url every so often regardless of activity. This basically puts ALL the session timeout handling on the javascript and disables the server side. This might not be desirable in some cases. Is it possible to set it up so that the keepalive is only active while their is true activity, or am I missing something?
Thanks for the plugin.
However, I have a long running script that takes longer than the idleTimeLimit
that I set and hence the plugin logs out the user when the idleTimeLimit
is reached.
I would therefore like to know if the plugin can detect an active AJAX request and wait for it to complete before the idle timer begins, that is, can active AJAX request be detected as an active event.
Hello,
This is not really an issue but a question. I didn't find any other means to contact you.
I want to implement your script but I have to download the store.js dependency.
Since 5 years ago the store.js changed and I don't find the right file to include with your script.
the store.min.js is not existing anymore. It is changed to store.everything.min.js which include other js files... please advise.
Thanks for your help
Hi, I set up and got it all working, but the code to change the button text seems to be ignored.
// idleTimeout
$(document).ready(function () {
$(document).idleTimeout({
redirectUrl: '/app_dev.php/security/logout',
idleTimeLimit: 840,
dialogDisplayLimit: 60,
activityEvents: 'click keypress scroll wheel mousewheel',
sessionKeepAliveTimer: false,
dialogTitle: 'Timed Sign Out',
dialogText: 'No activitiy has been detected for 14 minutes. You are about to be signed out of the system for security reasons.',
dialogTimeRemaining: 'Time Remaining: ',
dialogStayLoggedInButton: 'Stay Connected',
dialogLogOutNowButton: 'Sign Out'
});
});
The buttons still chow the default setting: All other string values display as per the example.
dialogStayLoggedInButton: 'Stay Logged In' - String
dialogLogOutNowButton: 'Log Out Now' - String
Thanks so much for your work on this script.
Craig Rayner
Since I have the sessionKeepAliveTimer set to false I added a $.get to the Stay Logged In function so the session is maintained.
Example Configuration - session time out at 10 mins, count down timer to display set at 60 seconds.
Problem Scenario -
User is on a mobile device such as ipad and then leaves for some time say by locking the screen or the screen times out. Once the user comes back, if the session has already timed out and when ideally the user should have been taken to the logout screen, the modal window still shows up with the count down timer message and keeps showing it for about 5-10 seconds before taking the user to the logout screen.
This gives false impression to the user that he can extend the session and also is not an ideal UX.
In the README it's described that $.fn.idleTimeout().logout();
should destroy the session. This doesn't work correctly because it creates a new $.fn.idleTimeout().
object with its default settings and then redirect you to default redirectUrl
, not the one that you specified in the previously created object. Hopefully there would be some interface where one could the same object after it was initialized already.
Workaround for me was to use it like this:
$idleTimeoutObj = $(document).idleTimeout({ ...
...
$idleTimeoutObj.logout()
Speaking of which, if this is going to be fixed, it can be taken in mind that this jQuery extension don't necessarily need to be executed on an element. It can be made as a plugin executed directly on jQuery object. So $.idleTimeout
and $.idleTimeout()
instead of $.fn.idleTimeout
and $(document).idleTimeout()
I was trying to do it like this and it worked but there were some issues so I didn't commit my code. I also had the idea of implementing the object as a Singleton which might not be bad direction to go
With multiple windows and on multi-tabbed browsers, selection of browser window (click on title bar) or selection of tab is not registered as an event.
Page Visibility wrapper may solve issue. Try Page Visibility API to find active window or tab
https://github.com/ai/visibility.js
http://www.nczonline.net/blog/2011/08/09/introduction-to-the-page-visibility-api/
http://stackoverflow.com/questions/2720658/how-to-detect-when-a-tab-is-focused-or-not-in-chrome-with-javascript?rq=1
http://stackoverflow.com/questions/1060008/is-there-a-way-to-detect-if-a-browser-window-is-not-currently-active
http://stackoverflow.com/questions/7568423/is-there-an-event-in-javascript-that-fires-when-user-changes-tabs-in-browser
Chrome, FireFox are fine with the multiple tabs (and DevEx MVC).. Works as expected
IE on the other hand (with DevEx MVC Extensions) blows up with more than 3 open tabs.
JavaScript critical error in (unknown source location)\n\nSCRIPT7: Out of memory
It appears to have a recursive looping problem after 2 or 3 tabs are redirected to logout.
Anyone know why, or any way to fix this ?
the KeepAliveUrl needs to be a public variable. It hits the same page.. which can be large or small (load wise) depending on what it is.. can we specify a specific keepalive URL which can be a simple url just to keep the session alive.
A iframe that is created dynamically (such as ones used by ckeditor when created in jquery-ui dialog) doesn't update the timeout with mouse or keyboard input.
I use jquery-ui with dialogs. and with-in those dialogs, I sometimes have CKeditor running. IF someone is in a dialog with a editor.. the timer times out, even if they're working because the iframe doesn't
exist until AFTER the timeout script loads. Need a away to include that iframe when it loads. Is there a way to attach the events to it after it loads the editor?
Hello Jill - This is Abhishek Mathur from IBM. We found your jquery-idleTimeout work excellent for our use, where we were struggling to get the idletimeout support for iframes. Your library has done the job for us. We would like to distribute this as part of our application. But for that, we need the license to be released under MIT license clause. That is IBM's guidelines.
Is that possible at all?
It is really urgent for us as we have a a couple of critical issues dependent on the usage of this library. Request you to respond and if possible release this under MIT license.
Thanks
Abhishek Mathur ([email protected])
startDialogTimer = function () {
dialogTimer = setInterval(function () {checkDialogTimeout();}, (currentConfig.idleCheckHeartbeat * 1000));
};
stopDialogTimer = function () {
clearInterval(dialogTimer);
clearInterval(remainingTimer);
};
It would be nice to have a couple more configuration variables such as:
I have a javascript SPA application where I am loading pages as iframes into javascript made tabs. Using Ext.JS components.
When logout happens, it logs out from the tab iframes but not the main page.
Any solution for this please?
I have loaded all 3 necessary js file and trying to implement timeout functionality in my project. i have wrote the program in header.jsp file as i need this function every where. but it is giving me above error. plus when i run the same functionality in individual jsp page, its working fine.
Hi,
I have a use case where a parent domain can have multiple applications and each application can have different timeout. But to have the consistency, the max timeout of the opened application will be used.
The timeout can be stored in local storage and can be shared with all the opened application of that particular parent domain. But how to change the timeout duration at run time without re-instantiating the idleTimeout plugin?
pre-requisite: the logout procedure involves redirection of the site to a third party authentication url, inorder to clear session on the third party end(federation authentication).
bug description
when the user clicks the logout button, if the redirect url(MVC action) takes long time to complete the request, the plugin is posting another request which makes the previous request to cancel.
I am facing an issue with session timeout when i am moving mouse
It would be nice to display the dialog countdown timer in the dialog itself so the user has an idea of how much time they have to make their choice.
Thanks for your hard work ๐
I am using Jquery-idleTimeout in my project. The issue is in IE-11 windows 10, when multiple tabs are opened. One tab gets logout page properly. other tabs redirects to logout page but it calls that page multiple times and timer displays NAN in the timing.
Is there updated script available ?
Documentation doesn't state how much of jQuery UI is needed. Assuming one wants the basic out-of-the-box functionality as in the demo:
This affects what bundle a user creates when downloading a package from jQuery UI
I was able to make this plugin work perfectly on multiple browsers, including Chrome, Edge, and IE11 on Windows 10. However, somehow, when I open the page including this plugin on
Explorer 11 (Version: 11.0.9600.18666; Update Version: 11.0.42) on Windows 2012 R2, it shows the following error message
"Please disable "Private Mode", or upgrade to a modern browser. Or perhaps a dependency file missing. Please see: http://github.com/marcuswestin/store.js."
I have certainly uploaded all necessary dependency files, including the following:
<script src="../Plugins/jqueryUI/jquery-1.12.4.js"></script> <script src="../Plugins/jqueryUI/jquery-ui.min.js"></script> <script src="../Plugins/JillElaineidleTimeout/store.min.js"></script> <script src="../Plugins/JillElaineidleTimeout/jquery-idleTimeout.js"></script>Again, this works perfectly on other browsers on Winows 10.
But for some reason, this IE11 on Windows 2012 R2 is showing that message, and the plugin doesn't work. I really need to make this work on the Win2012 R2 server.
Would anyone please provide comments on this issue?
Thanks so much for your time!
Test for 'sessionKeepAliveTimer' & 'sessionKeepAliveUrl' values. If either is false, do not start keep alive pings.
in the demo, if you just scroll one of the iframes up and down and don't do anything else on the page, the idle time does not pick that up as an activity, and the logout dialog will trigger.
http://jillelaine.github.io/jquery-idleTimeout/iframe-demo.html
my scenario is that i have an iframe, with a PDF or HTML inside of it, that requires a lot of reading. so, just scrolling up and down on the iframe should be detected as activity on the page, and not cause the timeout.
If I configured redirectUrl: false, and after idle time starting, customCallback call each 2 seconds(idleCheckHeartbeat) also dialog popup doesn't closing
We we make the dialog display for the pages having frameset.
Hi,
I want to integrate bootstrap popup instead of jquery UI, as my entire application is based on bootstrap.
I feel this plugin should not be dependent on jQuery UI, but should provide an option either to use built in popup by including jqueryUI or to use a popup of their choice.
This is chrome specific issue, I think.
As long as the page is in focus (active window), the mousemove event fires continuously resetting the idle timer.
I am using Chrome 39.0.2171.95 m, but I suspect it is not limited to this version
perhaps it maybe necessary to keep track of mouse position to reliably confirm mousemove events along the lines of http://stackoverflow.com/a/15086713
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.