I am working in Asp.net and I want to restrict the user while login, if the same user is already logged in or already connected.. I am creating a table in sql server USERS_CONNECTED and placed a single field USER_ID in it. When ever a user is logged in it’s id is searched in USERS_CONNECTED table. If id is not found then the user is allowed to connect and the user id is added in the said table. But the problem is when the X button(present on right top corner of the browser) is clicked to exit then the user id should be deleted from the USERS_CONNECTED table. WHERE SHOULD I WRITE THIS CODE ?? I MEAN ON WHAT EVENT ..
can anyone help…
Dev..
I am working in Asp.net and I want to restrict the user while login,
Share
You can handle end of a session. Add something like this to global.asax.cs file:
Just one thing to remember: it will not be fired immediately when the user closed his browser. This event will be fired when the session expires.