Getting a list of logged-in users in ASP.NET Identity

后端 未结 1 428
萌比男神i
萌比男神i 2021-02-05 15:06

I\'m getting started with ASP.NET Identity, but I\'ve been unable to find a way to fetch a list of the current logged in users. To get all users I can just user

         


        
相关标签:
1条回答
  • 2021-02-05 15:40

    There is no built in support for this. One simple way you could implement this would be to add a LastActivityDate to your user, which is updated whenever a user does something on your site. Then you can just query against that looking for users who are active within some reasonable time, like 30 minutes and display that.

    0 讨论(0)
提交回复
热议问题