I have created an ASP.NET web application using MsSQL and Entity Framework 6.4.4 with individual account authentication, the app works fine but I would like to track user last login time/date as well as login count each time the user connects to the web application.
is there a way to do it, so far I din't find a solution in the many search done. thanks for the help

Pasang TamangRank #449 · 5.6K reputationPosted Jan 16, 2023, 12:32 PM EST
Hi,
If you are using ASP.NET Identity then you can customize it. Check below code example.
public class ApplicationUser : IdentityUser { public DateTime LastLoginDate{ get; set; } public int LoginCount{ get; set; } }Check this article also https://procodeguide.com/asp-net-core/user-management-in-aspnet-core/. This explains a lot about customizing Identity.
Regards,
Pasang
Pasang TamangRank #449 · 5.6K reputationPosted Jan 16, 2023, 12:36 PM EST
You can check this article also https://www.c-sharpcorner.com/UploadFile/90fded/how-to-customized-identity-in-Asp-Net-mvc5/.
Btw, you will have to update last login date when user login into the system.
Regards,
Pasang
Vishal JoshiRank #377 · 6.7K reputationPosted Jan 17, 2023, 12:19 AM EST
Hello
There are several ways to track user login activity.
Thanks
Raymond G191 reputationPosted Jan 17, 2023, 2:27 AM EST
Hi, thanks for the feedbacks
I have followed Passang procedure and looks to work for a NEW login but I still miss track of users already logged in who checked the remember me, I will try to find a solution for this.