Click to See Complete Forum and Search --> : To make a javascript function execute only at the time of closing a window and not wh


saleemy2ks
September 26th, 2006, 01:38 AM
Hi,
In our asp.net 1.1 application client has told us to maintain one session per application means only one user can login at a time and if another user tries to login then we should tell that user that another user has already logged in. So all these things i finished doing but i am facing a problem when user closes the window directly without bieng logging out and the default session timeout is about 20 minutes so if a user has closed the window another user cannot login for another 20 minutes till the session expires.
So to avoid this using javascript i have written a function which will execute onbeforepageload event which will post to the login page with a querysting parameter which tells that the user has clicked the logout button and i am ending the session of that user. This is working fine for the close window but also it is getting executed when we refresh the page. through some javascript coding i got succeede to avoid the F5 refresh but we have to avoid even others options of refresh also. and we cannot disable those options.
hope you have understood my problem. So can anybody please help in this matter how to solve this problem.

Thanks in advance
Syed Saleem

jasonli
September 26th, 2006, 07:34 AM
afaik, you can't run javascript when user click "X" to close IE.