-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Session lost even if clicked on Stay Logged In if counter is <=5 seconds #18
Comments
First of all, there is nothing in the jquery-idleTimeout plugin's code that does anything directly to the user's session. The plugin can 'ping' the server regularly (configurable via You can turn this ping off completely: set Make sure the Note that the plugin does not ping the server while the warning dialog (countdown timer) is visible. Your server (sometimes) kills the session when the warning dialog is visible, so this indicates to me that your server session timeout setting is shorter than the interval between pings. Or maybe the plugin's pings are not 'seen' by the server for some reason? ASP's default session timeout is 20 minutes. Typically, you'd want to set the server's session timeout to greater than your app's session timeout. For example, if you want users to be 'timed out' after 30 minutes of inactivity, set the server's session timeout to 35 minutes. A basic ASP session tutorial is here: http://www.w3schools.com/asp/asp_ref_session.asp Sometimes the session can be lost even though the user is active (pings, new pages, etc). This page gives some other possibilities for timeouts: http://machinesaredigging.com/2013/10/29/how-does-a-web-session-work/ Make sure you use the correct variable names to configure the plugin: spelling and case matters. It's Post back what you learn so that others may benefit! Thank you! |
Also, please read this: http://stackoverflow.com/questions/648992/session-timeout-in-asp-net |
Hi, Thank you for your reply. I have set the sessionKeepAliveTimer = 600 but did not specify a sessionKeepAliveUrl. I believe this will get the current url instead right? I have also checked in firebug that the url is successfully being 'ping-ed'. Also my session timeout (set in web.config and IIS) is already set to 30 minutes, so it's larger than the interval between the pings. And you're right, the idleTimeActivity is only a typo. I'm using the correct name. I tried setting the idleTimeLimit to a value less than 30 minutes, however, I still get timed out if clicking on Stay Logged In with only a few seconds left (<=5). I'm using MVC and OWIN authentication, the cookie being created by OWIN is also set to 30 minutes timespan expiration. Is there any chance someone have encountered this issue? Many thanks! |
You should load the jquery-idleTimeout-for-testing.js and watch the console in Firebug. What happens when you click the Stay Logged In button? Are you redirected to the logout page anyway? Again, there is nothing in the jquery-idleTimeout code that actually causes a user timeout: all it does is track idleness. It is up to the implementer (you) to cause your idle users to timeout. Typically this is done with code that executes when the user is redirected to the logout page...or with code added to the optional No one else has reported this problem, so I am puzzled. I am not familiar with ASP,sorry. Is the OWIN cookie set to expire after 30 minutes even if the user is not idle? What happens if you set all your server side timeouts to 35 minutes? |
Okay, I can confirm that there is a bug. The plugin does 'time out' just a few seconds before the 'countdown' completes. In other words, Time Remaining may display 2-3 seconds left when timeout occurs. I will patch this as soon as possible. Thank you for your patience. |
Hello, I was wondering whether any progress has been made on this issue? I am running into the same problem. Thanks! |
I have not had time to work on code recently, but I think the code below will fix the problem. Would you please try it, and let me know? The problem occurred because there is typically a several second delay between the starting of the dialog timer and the display of the warning dialog. The only change in the code below is to test that the warning dialog 'Time Remaining' display has reached zero before logging out the user. The result will be that the user will be given a few seconds 'grace' before being logged out.
|
…Elaine#18) Fix displaying 'NaN' in the dialog
Thanks @JillElaine! The fix you posted above mostly worked. I made two slight modifications and submitted a pull request (#31). The changes:
changed to
as an error was thrown otherwise (claiming 'mins' wasn't defined). I also changed
to
in order to avoid displaying 'NaN' in the dialog after the counter had reached 0. |
Thank you for this suggested change for the countdownDisplay to avoid NaN. I don't have time to work on my code now, but hope to improve it in the future. |
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!
The text was updated successfully, but these errors were encountered: