I need to implement audit trail for following
sessionId UserId DisplayName LoginTime LogOutTime SessionDuration
I need to implement audit trail for following
sessionId UserId DisplayName LoginTime LogOutTime SessionDuration
Insert a row in the Audit Trail table when they log on. Store the ID of that in the user's Session. Update the row, using the ID stored in the Session, when they LogOff.
If they do NOT logoff its a bit more tricky - their session will, presumably, expire of its own accord XXX minutes after last activity.
You could record a "most recent activity" column too, so each time they do something you upload the Date/Time in that column; then if they don't logoff the LogOutTime will be NULL, but you will have the "most recent activity" time instead.
No one has followed this question yet.