Detect Browser or Tab Close Event

Welcome to Wisej Support.
Questions, suggestions and plain old bugs - are all welcome here!


I want to log user’s activity to a database table during login, logout, session expired and when browser is closed. How do I detect or intercept when a user closes the browser, tab, exit menu and Alt-F4?

A small sample would be highly appreciated.


  • You must to post comments

Unfortunately for a browser there is no difference between closing the browser, closing the tab, refreshing or navigating.

Wisej has a keepalive system that will detect a dead session and kill it. You can handle Application.ApplicationExit to know that the session has been disposed. You cannot really do much in ApplicationExit since the session is already gone. The wisej objects (windows, controls, etc) are available , but if you change them the changes are lost.

You can also handle Application.SessionTimeout which occurs right before removing the session. In SessionTimeout you can still handle objects in that session.


  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
File Name Size
There are currently no files uploaded.
Maximum number of files 5, maximum file size 3.9MB.
Supported file formats: zip pdf gif jpg bmp png cs vb theme json mixin.theme