This content has been marked as final. Show 7 replies
Store a unique ID for the user in a cookie, and store the data relating to
the user in the DB, keyed on that unique ID. When a user shows up with
such a cookie set, load the data from the DB, and bung it back in their new
I'm using "bung" in it's technical sense, here ;-)
Yes, that's what I had planned on doing, but there are 847 session variables to track and I'm looking for an efficient way to store & retrieve them. I see the session structure, is it possible to store that in a blob field?
I had a client that had hundreds of session variables scattered in hundreds of CF pages. There was very little CFLOCKing, and consequently the apps were quite unstable in a loaded environment.
What I finally did was to copy the session scope variables to ses.request scope variables of the same name, then did a global replace of session. with ses.request. In OnRequestEnd.cfm, and immediately before all CFLOCATIONs, I copied ths ses.request scope back to session scope (locked, of course). There was no measurable performance hit, and the apps were rock solid.
Perhaps you could copy your client variables to session scope; then back again in OnRequestEnd.cfm
> Yes, that's what I had planned on doing, but there are 847 session variables to
> track and I'm looking for an efficient way to store & retrieve them. I see the
> session structure, is it possible to store that in a blob field?
Yep, just serialise the whols truct with CFWDDX and chuck it in a clob (not
I have been able to use the wddx to deserialize and store the data in my database, what I'm trying to do now is read it from the datbase, and then reassign those session values to the client but I keep getting errors.
I used <cfwddx action="wddx2cfml" input="#getsession.appsession#" output="AppSession">
Then I try and set my session structure equal to the appsession but it retains the previous session data..
My question is how do I replace the current client info with the session data I pull from the databasae?
Okay, to answer my own question here:
My question is how do I replace the current client info with the session data I pull from the database?
You use StructAppend
#StructAppend(session, AppSession, True)#
Viva CF Docs! ;)