0

Is there Any way to achieve "Allow only one user login in Asp.Net Core".

I am working on Asp.Net Core Web Application. My Requirement is Allow Only One Login per device to the application For Example if X logins app in one device doesn't logout after use. And again same user logins in another device then first device session should be automatically logged off.

Is There any solution? I searched on numerous blogs but I didn't find proper solution for my requirement.

Any one suggest solution is appreciated.

Uwe Keim
  • 38,279
  • 56
  • 171
  • 280
  • This is such an outdated approach to login sessions, are you sure you want this? What actual business requirement does this fulfill? If you want this, you can give users a session ID in a cookie or something like that, and with each request you check if the session ID from the cookie is still valid, or whether a new session was started and the old cookie (and thereby login) should be invalidated. Edit: see duplicate, this uses the SecurityStamp, which does not invalidate existing JWT tokens. – CodeCaster Nov 24 '21 at 12:28

0 Answers0