HI
I wanna timeout session from client page,i tried below code but not able to execute code need some help of how i can handle OK or CANCEL events from user
The beforeunload event can only be used to display a dialog to the user that he/she is about to navigate away from the current page. This dialog is browser-controlled and you can only customize the dialog's warning, not it's outcome. Therefore, you cannot execute an action based on the outcome of the dialog. This is mainly for security reasons, to prevent people from being forced to stay on the current page.
If you want to cleanup any session data after the person leaves the current page, you should consider using one (or several) of these alternative constructions: