locked
Block login on same time from another browser RRS feed

  • Question

  • User746671234 posted

    Hello, I have to block login from another browser at same time if user is login.  I thought lots of logic like I will store a tag once user login and update it on logout but what if user didn't press logout button and close the browser directly.

    Is there any easiest way?  I am using asp.net

    Saturday, February 8, 2020 5:08 PM

All replies

  • User1535942433 posted

    Hi ravininave,

    what if user didn't press logout button and close the browser directly.

    Accroding to your description,I suggest you could remove a user from the list when the Session_End event fires in Global.asax to handle a user not logging out properly.

    More deatils, you could refer to below article:

    https://stackoverflow.com/questions/2599118/in-asp-net-site-how-to-prevent-multiple-logins-of-same-user-id

    Best regards,

    Yijing Sun

    Monday, February 10, 2020 2:48 AM
  • User746671234 posted

    Well I am not using membership

    Monday, February 10, 2020 8:44 AM
  • User1535942433 posted

    Hi ravininave,

    Accroding to your description,as far as I think,I suggest you could get the session id when user successfully logged in, just store the session id in your datastore(associate with

    username).Delete the session id when Session_End event fires or user manually logout.

    If user try to login with the same username from other machine, verify the session id against database. 

    More details,you could refer to below article:

    https://www.codeproject.com/Questions/593492/Preventplusconcurrentpluslogins

    Best regards,

    Yijing Sun

    Tuesday, February 11, 2020 5:14 AM