UPDATE!! - 7/25/2011 - New version + moved to github - see this post for details.
There were a couple of minor tweaks, but it's basically just an update to bring the control and demo app current.
The attached zip contains a Visual Studio 2010 solution with 2 projects. One for the Timeout control itself, and another for a demo web app using a Master page setup.
If you're not familiar with the control, please read through the previous two posts that detail its usage here (v2) and here (v1).
Thx,, i luv this control!
ReplyDeleteI have set the timeout to be 2 minutes. When the user presses the OK button the session is extended as expected. When the user press "X" to close the dialog box or lets the time expire the session still seems to be extended. I would expect the session to expire in this case? Am I missing something?
ReplyDeleteYou ave really nice Blog here and I am saving it in my favorite list. Keep posting similar stuff.
ReplyDeleteAnonymous-
ReplyDeleteSorry I'm just now getting back to you.
I am guessing what's happening there has to do with timing. You have to remember there's no exact science here. Session lives on the server, so all we can do is start a timer on the client and hope it's as close to being in sync with the server as possible.
Are you certain the old session is really extended (and it's not actually creating a new one)?
If so, then that's surprising but I'm guessing what may be happening is that the client timer elapses a second or two early (which is odd - if anything you'd think it'd be a second or two late) and performs the redirect (which communicates with the server and therefore extends the session - or creates a new session).
I'd have to do some testing to determine which is the case, but like I said your results could differ a second or two in some situations.
It might be a good idea to add a Session.Clear() or Destroy() in the code behind for the timeout page if you want to ensure that as soon as they get there Session is reliably destroyed. That way whenever the redirect occurred, even if the old session was inadvertently extended - it'd be killed as soon as the page loaded.
I may have to add a little code to the demo to see if I can repro what you're seeing.
Thanks-
Excellent tool thanks Im using it in my project and it works perfectly.....
ReplyDeleteGreat control here! I just implemented it and it works great.
ReplyDeleteOne thing I noticed that may be what the poster above said is that my Timeout.aspx page will actually extend the session, so if the client redirects a second or two early then by going to the Timeout page, the session is extended. Adding a Session.Abandon() to the Timeout.aspx codebehind fixes it.
Thanks again.
Hi, this is great, just have a problem here... the popup appears even if the user is not authenticated. How can we validate so the popup just appears when the user is authenticated?
ReplyDeleteThanks a lot.
Anonymous-
ReplyDeleteWhy don't you just add some code in the code-behind for the page and disable the control at page load if the user isnot authenticated?
Hi,
ReplyDeleteI cannot find the zip attachment along with this post. The previous versions I found, but for the new one, I cant find it.
Hi. I can't find any download–able version of the control. Is it my fault or a fault of my browser? Tried almost all of them ;-]
ReplyDeletesorry guys, my files are all on my skydrive account and yesterday microsoft rolled out a completely revamped skydrive UI. it broke *all* the links. I've gotta go back through all my posts and get them updated - but I did go ahead and fix this one. I probably need to look at putting this stuff on codeplex or github or something anyway.
ReplyDeleteThis works fine in the test project, but does not when I attempt to integrate it with my project. Set timeout to 2 minutes. When on the page that I have a Flash component embedded: At 1 minute, no popup displays, but a huge blank space opens at the bottom of the page. Also, at this point all page links do absolutely nothing. At 2 minutes I am redirected to Login.aspx as expected. When on the page with NO Flash component, a silhouette of the popup appears at 1 minute. I can see/click the OK button but its as if the popup is missing parts and is transparent. Any ideas?
ReplyDeleteKent-
ReplyDeleteIs your jquery ui theme installed and working?
Ahhh, missed that (new to jQuery). Thanks a lot!
ReplyDeleteKenneth,
ReplyDeleteThanks so much for this - the code is very tight and easy to follow. Is this subject to any license?
Stefan-
ReplyDeleteNo license - do what you like with it. Good luck-
it gets an error as follows ..
ReplyDeleteError: DOM Exception: INVALID_CHARACTER_ERR (5)
Anonymous-
ReplyDeleteIs that an error when you run the demo app or from your own project? Can you tell me a little more info about when/where exactly you see that?
Thanks-
Kenneth
Hi again,
ReplyDeletei am getting this on yours demo app.
When i run the project on VS 2010, it happens ..
what kind of info do u need ?
Kenneth,
ReplyDeleteWorks great now, but I have a need to reset the timeout from somewhere other than the dialog button. I can call 'CallServer()' from the console, but how would I access '_resetTimeout()' ? Neither '_resetTimeout()' nor 'tsc._resetTimeout()' work from the console.
Kent-
ReplyDeleteI've just reworked the control and moved it to github (see my latest blog post for details - http://programmerramblings.blogspot.com/2011/07/aspnet-session-timeout-control-with.html).
The new version makes it easier to do what you are attempting by exposing a public method for the reset. check it out and let me know what you think-
Hey Kenneth, great control!
ReplyDeleteI am having a issue where the display label isn't getting updated to the new session timeout time when the user clicks continue. Could u help?
Jake-
ReplyDeleteAre you using the latest version on github? If not, I'd recommend using that one. It's much more flexible than the one attached to this blog post.
Regardless, you should be seeing a JavaScript error or something if the timers aren't being reset upon clicking continue. Are you sure there's no error at all? Some browsers won't show them by default.
Kenneth
We have a page with a jquery dialog opened. For some unknown reason the timeout popup does not appear when there is already another jquery dialog. I have tried setting zIndex property.
ReplyDeleteAre you seeing any JavaScript errors? Also you probably want to use the latest version from github.
ReplyDeleteThanks-
Kenneth
We have the timeout in the master page and we are displaying a jquery dialog with an aspx page in. For some reason the timeout counts down correctly but when it tries to get the object it's undefined because does not exist in the aspx loaded in to the dialog which is not part of master page
ReplyDeleteAnonymous-
ReplyDeleteI'll try to recreate the usage scenario you described using the demo on github and see if I can figure anything out. It sounds like I can just add a new standalone aspx page to the project and open it in a jQuery UI dialog window and wait for the app to timeout - and hopefully I'll see the behavior your described. Let me know if that doesn't sound correct.
Thanks-
Kenneth
Anonymous-
ReplyDeleteI was unable to recreate the problem you described in the demo project - perhaps I'm loading the dialog differently or something? I committed the new test page as part of the demo project on github. Can you take a look and see if you're doing something different? Please also note that I did take the opportunity to update the demo project to jQuery 1.7 and jQuery UI 1.8.16. The new page I added is named jQueryUiMultipleDialogs.aspx. Please take a look and let me know-
Thanks-
Kenneth
Hi;
ReplyDeleteI used this tool inside a page that all activities are made inside iframe like the code below.
In this scenario session timeout is not be refreshed. So, even I make an action to reset session timeout, this new reseted time count isn't going to Timeout tool.
Do you have any suggestion about this issue?
Thanks
example code:
http://pastebin.com/NVXe2828