x

How to implement audit trail for session log??

I need to implement audit trail for following

                    
sessionId                    
UserId                    
DisplayName                    
LoginTime                    
LogOutTime                    
SessionDuration                    

more ▼

asked Nov 09, 2009 at 06:56 AM in Default

avatar image

savibp
52 6 7 8

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

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.

more ▼

answered Nov 09, 2009 at 08:33 AM

avatar image

Kristen ♦
2.2k 7 11 14

(comments are locked)
10|1200 characters needed characters left

I need to do the same but cannot find a solution to this paradigm. Someone please help!

more ▼

answered Oct 18, 2011 at 03:51 AM

avatar image

JWDBA
1

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x2077
x102
x49

asked: Nov 09, 2009 at 06:56 AM

Seen: 2000 times

Last Updated: Nov 09, 2009 at 08:35 AM

Copyright 2016 Redgate Software. Privacy Policy