asp.net - No Multiple Login on Same machine but same browser allowed -


i have simple requirement of not allowing user log multiple browsers @ time. same browser fine.

what simplest thing can done?

technlogy : .net 4.0 , sql sever 2008 r2

see advices below:

  1. store lastactivitydate each user. if using asp.net sqlmembershipprovider - field exists there, if use authentication mechanisms - need create , update each request of user.
  2. add additional boolean field loggedin each user. field set true when user login. if using asp.net sqlmembershipprovider can store value in comment field.
  3. when user closes browser send request server 'logout' user, means set loggedin field false. use window.onbeforeunload javascript event that.
  4. on user login should check loggedin field user, if false - process operation. if not - should check lastactivitydate value, , if older timeout define (lets 3 minutes) process operation. if not - reject , show error message. additinal check required because cannot guarantee window.onbeforeunload executed.
  5. the final step javascript consequentially calls server action in timeout updates lastactivitydate. script should defined on each page accessible logged in user.

i hope approach clear.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -