Auto User Logout Popup |
[eluser]Fielder[/eluser]
I'm using dxAuth and am trying to figure out how to automatically display to the user that they've been logged out when they've idled beyond the allowable time. I presume I would need to use javascript to create and count down a timer (to be reset everytime they perform an action), then automatically display a notification popup box (perhaps a javascript Alert?) when it reaches zero. This way when the user returns to their desk they are already notified that they've been logged out and need to log back in, instead of simply not being aware. Anyone have any pseudo code they can share and I'll go work on it from there? Thanks.
[eluser]Thorpe Obazee[/eluser]
Shouldn't your post be in another part of the forums? Anyway, I'd go for AJAX.
[eluser]davidbehler[/eluser]
You could use the prototype periodical updater: http://www.prototypejs.org/api/ajax/periodicalUpdater You would have to create a controller with a function that you can call using the updater and check wether the returned value indicates the user is logged out or no. But beware, that the ajax call would cause the session to update and reset the date of the last action...you would have to alter your auth class to only update the session if any controller/function but the one used to checking the user state is called.
[eluser]louis w[/eluser]
waldmeister is spot on. This is what I use Code: [script] Your $config['sess_expiration'] value should match the same time amount so that it would expire for users without javascript too (they would not get redirected thou, just kicked on at next request).
[eluser]seanloving[/eluser]
seems like this is independent of authentication library / implementation, non? --Sean Loving |
Welcome Guest, Not a member yet? Register Sign In |