In my asp.net website, I want to prevent same user login into website simultaneously from two different browsers. In order to do so, I had created table (say userloggedin) that will store user id and time once user login. when user attempts to login from different browser, user will not be redirected into website from that new browser he is attempting to login (if user's record is in userloggedin table). User's record will be deleted when user logout, thus clearing log for allowing next time login. The problem i am facing using this approach is when user clicks on close button from title bar, browser closes. Here, record will not be deleted from userloggedin table.( i need to delete from this table to allow future login). I had used window.onbeforeunload and kept a code to delete from userloggedin in here. But this function gets fired on every postback. How can i delete record from userloggedin table on click of close button? Any alternative approach is welcome..
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)