Prev: Consuming the Gunbroker API
Next: err.io.short_read
From: coldfuse228 on 6 Feb 2007 15:07 Hi Hi BKBK: I think I have something working here, I'm just wondering if you see any potential issues with this. Thank you so much for your help. This is how my auditComponents system for all users works: 1.) Anytime a user logs in, my application.cfm does: Checks if user is logged in and if login is already recorded in auditComponents table - basically I want to log every user's successful login. Inside this conditional block, I set loginAlreadyBeenRecorded to 1 so that auditComponents table will only be written once with the "Logged in" message. Then, I call function that writes auditComponents message to table, and that function also returns a unique id from that table too. I use this unique id to set my Session.visitIDentification variable that I will use later. I also clear session variables when I log out. My shortened code for application.cfm is: ... <cfparam name="Session.loginAlreadyBeenRecorded" default=0> <cfparam name="Session.visitIDentification" default=0> <cfif (Len(Trim(getAuthUser())) NEQ 0) AND Session.loginAlreadyBeenRecorded eq 0> <cfset session.loginAlreadyBeenRecorded = 1> <cfinvoke component="components.auditComponents" method="auditComponentsUserLogin" returnVariable="visitIDentification"> ... <cfset Session.visitIDentification = visitIDentification> </cfif> <cfif IsDefined("Form.logout")> <cflock timeout=20 scope="Session" type="Exclusive"> <cfset StructDelete(Session, "loginAlreadyBeenRecorded")> </cflock> </cfif> ... 2.) Now that I have this session unique id (Session.visitIDentification), I will log a message for all of users actions. I call a function that writes a message to auditComponents table of user's actions and also pass in the Session.visitIDentification (So that when I look at db table, I could just select * of that visitIDentification and I would get all actions for that visit : <cfinvoke component="components.auditComponents" method="auditComponentsUserActions"> <cfinvokeargument name="visitIDentification" value="#Session.visitIDentification#"> ... </cfinvoke> 3.) Also, do I need cflocks anywhere here? Thank you so much for your help, C
From: coldfuse228 on 6 Feb 2007 16:19
Hi BKBK, like before with my new code, do you see any potential for data mixup, like user actions being confused? I don't see any as of now b/c I'm using a unique visitIDentification variable returned from my function(calls stored procedure) and also I'm using sessions. Also, would different browsers have different effects? Thanks so much, C |