Sitecore LastActivityDate is updated by the act of trying to view it.

Okay, to go with my LastLoginDate frustrations, I also noticed that when I opened up a User’s Information tab, it always showed the current date and time. Even when I know that user is not in use. E.g.:

This is a test user, and hasn’t been used in the last few days. So, what gives?

Well, it seemed that the act of opening the dialog updates the Last Activity Date. That’s unfortunate. I started looking into Membership.GetUser() … and oh, look:

And then there is this:

Okay, there’s a documentation fail for Microsoft there – it’s completely impossible to see which overloads it’s talking about at the end. But I think it’s pretty clear that whatever one Sitecore is using, it’s updating the LastActivityDate.

Which… kind of makes it completely useless.

There are overloads which don’t do this, but somewhere in Sitecore there’s at least one place where it does. Is it a Sitecore bug? Yes, I think so – the Membership class is a bit weird in setting that LastActivityDate value automatically they way it does, but it is documented.

EDIT: Dammit, I’ve found references to this problem from 10 years ago. 10 years to bloody fix it. – The lastactivityDate in ASPNET_USERS in Sitecore core database for all users is getting updated continuously – Sitecore Community

Sitecore LastActivityDate is updated by the act of trying to view it.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.