1
votes

After authenticating a user their details are stored in the client scope. When we redirect through to their dashboard all the new items added to the client scope get wiped. I've cleared my cookies and cache which is now making it apparent that no client varaibles are actually being stored in cookies (I had some leftover from before I swapped the application scope).

This started happening after I updated an app from using application.cfm to application.cfc

I have the following application settings defined:

<cfset this.SessionManagement = true>
<cfset this.ClientManagement = true>
<cfset this.SetClientCookies = true>
<cfset this.sessionTimeout = CreateTimeSpan(0,8,0,0)>
<cfset this.applicationTimeout = CreateTimeSpan(0,8,0,0)>

Can you suggest any reasons why client variables would just disappear?

1
It's generally not considered a good idea to store variables in the client scope, you're probably better off using session scope if possible. e.g. read dopefly.com/pages/ColdFusionClientVariablesFinalNail.cfm - duncan
I think that as little as possible should be stored in session. With modern browsers, it is too easy for those variables to change values in a way the programmer did not intend. - Dan Bracuk
What are you using for your client variable store? - ale
As much as I agree with you guys @duncan, I'm not replacing the ancient system that exists, I'm just trying to convert it to use application.cfc instead of application.cfm - Rumpleteaser
"This started happening after I updated an app from using application.cfm to application.cfc" - does it stop happening if you revert to the previous code? If so, change it a bit at a time until you identify the code that breaks it. - Peter Boughton

1 Answers

2
votes

After a great deal of troubleshooting I identified that it was the application name that was clearing the client scope. Our name mimics the version and release number of our application so it had full stops (and possibly hyphens) in it. After I converted everything to underscores it started working.

I had done it this way because all our other applications run using the same convention, so I'm not sure why they work and this one doesn't, but that was the solution.

<cfset this.name = "client_product_v1.6.1.0.r1.o">

became

<cfset this.name = "client_product_v1_6_1_0_r1_o">

And it started working.