How could I capture the Session Expire & Browser closed event

0
0

Hi all,

I am working on access log function which is to capture the duration of session on application, the question is, How could I capture the “Session Expire” & “Browser Closed” event on Wisej application. Thanks a lot

  • You must to post comments
0
0

Hi Ben, a session timeout of 3600 is 1 hour. There is no way to detect when the browser is closed, there isn’t such an event in javascript. Closing the browser is identical to hitting refresh. Are you using a custom countdown in Application.SessionTimeout? The built-in one counts down the session-timeout seconds and then terminates the session on the client which causes the server to dispose the session immediately.

I’d reduce the session timeout to 1 minute or 3 minutes. The session will never timeout until there is user activity anyway. Or you can override ApplicationSessionTimeout and decide when to terminate. To force the disposal of a session use Application.Exit().

  • You must to post comments
0
0

The Application.ApplicationExit event is fired when the session is disposed.

There is no Browser Closed event. There is no way with any browser to detect when a browser is closed. The window.onbeforeunload and window.onunload events (see https://developer.mozilla.org) fire when refreshing, changing the url, navigating.

  • Ben Lau
    Hi Luca, Thank you for your help first! Currently I set the sessionTimeout value in Default.json to 3600 and handle the Application.ApplicationExit Event. When I have closed the browser or the timeout window reaches the end of counter, the Application.ApplicationExit event was fired after a long period of time. I would like to know It is possible to fire the Application.ApplicationExit event immediately (or as soon as possible) after the built-in timeout window reaches the end of counter / browser was closed. Thanks a lot
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.