Mark Tabor

Mark Tabor

  • 564
  • 2k
  • 448.9k

How to log out exiting user if a new user tried to login from another

Jul 25 2024 11:54 AM

I have a use case in which I am NOT USING IDENTITY , I have login functionality up and running now I would like when someone else tried to login from another device using the same credentials then it should logout the existing user , I am not using session rather I am using authentication scheme as cookie, I have a table in which for every user login I delete his/her previous record and insert the new record (userid,time,ip_address) , how to logout the existing user when someone login from another device using same credentials . 

I have added AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme) 


Answers (1)