Question

We are using DNN 6.2.6 and I have the SiteLog feature turned on. When I query the DNN SiteLog table to see when a user has logged in, the latest is: 9/4/2013

SELECT u.[UserID] DNNID
  ,u.[Username] 
  ,u.[FirstName] [First Name]
  ,u.[LastName] [Last Name]
  ,u.[DisplayName] [Display Name]
  ,sl.[DateTime] [Access Date] 
  , r.RoleName [Role]
  , t.TabName [Page Name]
FROM [dnnDB].[dbo].[SiteLog] sl 
LEFT JOIN dnnDB.dbo.Users u on u.UserID = sl.UserId 
LEFT JOIN dnnDB.dbo.UserRoles ur on u.UserID = ur.UserID 
LEFT JOIN dnnDB.dbo.Roles r on ur.RoleID = r.RoleID 
LEFT JOIN dnnDB.dbo.Tabs t on sl.TabId = t.TabID 
WHERE 1=1 
AND u.Username = 'JDoe' 
AND sl.[DateTime] >= DATEADD(YYYY, -1, getdate())
ORDER by [Access Date] desc 

But, when I look at the aspnet_Membership table's LastLoginDate , it shows 9/23/2013:

SELECT *
FROM [dnnDB].[dbo].[aspnet_Membership]
WHERE userid = 'ABCDEF12-1234-ABCD-ABCD-AD5BAA5C7EBF'

Any ideas why they are not in sync?

Is the aspnet_Membership accurate? or SiteLog?

Was it helpful?

Solution

I would imagine that _Membership is more accurate, Sitelog probably recognizes the actual login itself, where _Membership recognizes that the user last visited the site on the 23rd?

That's just my assumption though, I haven't had a chance to go through the code to confirm.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top