Last login for a User

Vote:
 

Is there any way to find out when a user was the last login to Episerver? 

#216448
Feb 06, 2020 13:38
Vote:
 

If you are using MembershipProvider, then you can use https://docs.microsoft.com/en-us/dotnet/api/system.web.security.membershipuser.lastlogindate?view=netframework-4.8

If you are using AspNetIdentity, you would need to add custom property to your identity class (inherits from ApplicationUser), then update that property when the user logs in successfully 

#216450
Feb 06, 2020 14:20
Vote:
 

@Quan Mai, ApplicationUser already has the LastLoginDate property and I managed to access it. So I don't have to manually do any saving/update. Thanks for pointing to ApplicationUser

#216517
Feb 07, 2020 12:42
Quan Mai - Feb 07, 2020 12:44
true. I started with IdentityUser and changed my answer halfway when I realized you should be using ApplicationUser without double checking it. good that you found what you need
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.