Webapp Idle

Hi all,

I am trying to force the session to logout when user idle for a certain period of time. I have a login page (webpage), and a main page (webpage) with containers. Here is my thought:

  1. In LoginPage.shown, add session.timeout = 0
  2. In MainPage.shown, add session.timeout = 300
  3. When idle time is met, popup a webdialog with timer countdown from 10 to 1 alerting the user the session is going to logout, there is a “cancel” button that the user can click on and return to the app
  4. If the user does nothing, execute LoginPage.show (suppose session.timeout will set to 0 in the shown event)
  5. If the user presses cancel, execute self.close

However there are 2 problems:

  1. When the user presses cancel in the alerting webdialog, it returns to the app, but never timeout anymore
  2. If “cancel” button is not pressed and returns to Login Page, sometimes the webdialog still popsup

Anything I did wrong?

Check on that. The simple act of moving the mouse resets that timer to zero so it’ll be another 5 minutes. [quote=371806:@Tony Lam]If “cancel” button is not pressed and returns to Login Page, sometimes the webdialog still popsup[/quote]
Is the Shown event firing?

Sorry, is my typo, problem fixed.