How to check if my user is online Asp.net Identity?

Asked

Viewed 774 times

2

I want to block so he can’t use the same login on multiple machines.

So I need to know if he’s online, how do I do it on Asp.net identitty?

  • Out of curiosity, what is the purpose of denying the login? Would it be a kind of license control? or security?

  • Jose license control, for example. What prevents a company from hiring your software for 1 user, and use in all sectors? rsrs

  • Got it. For this you will have to create a slightly more complex access control, working together with Asp.Net Identity. I have some suggestions, maybe I’ll draft a response with a possible solution, when I have time left.

  • Jone, I’ve been looking to use Signalr, so I leave a list of logged-in users in memory, something like that...

  • It’s an excellent option. I’ve done something similar to using Signalr in an application.

1 answer

3

http connections don’t stay open. This way, you don’t know if a user is logged in or not.

The most common solution for this type of problem would be the Heartbeat standard. You make a javascript that, from time to time (with setInterval), sends an ajax request to the server to inform that the user is still browsing in your application.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.