• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Client Variables lost

Explorer ,
Aug 22, 2023 Aug 22, 2023

Copy link to clipboard

Copied

I am assisting in moving a site that was on CF11 to CF2021. There has been a lot to fix but I have had trouble on on instace in where there are client variables that are lost from one page to another.

 

When a user logs in, client variables are set.Server Client on Admin screen.JPG

However, when users click to go to a part of that websiet that uses Model Glue for this and only this folder, the client variables and session variables are cleared. Now, on CF 11, this worked no problem. The variables exist without issue. However, on CF2021, those variables are cleared.

 

Server Client from within budet.JPG

Now, yes, there is an Application.cfc within this folder and I suspect its the reason why this is cleared (there is no app.cfc in the folders before this again, old appliction not my code)

 

The problem is, that there is code within this model glue folder that tries to refrence that now cleared (on CF2021) variable. I'm lookng for a good solution, is there a way to move that client information into this folder which is needed for some functionality?

 

Views

225

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 22, 2023 Aug 22, 2023

Copy link to clipboard

Copied

I think there is another diagnostic to help find what's happening. First, I don't think it's due to issues arising from having multiple application.cfc or .cfm files, as those started with security changes to cf made in CF10. They're not new in cf2016 or above.

 

Second, there are various cf admin settings which could be impacting what you see...and it may be that you or someone else didn't setup ALL of the cf2021 admin settings to be the same as you had in cf11. See especially the bottom of the "memory variables" page. (And I have a talk on comparing and easily COMPARING cf admin settings between versions, at carehart.org/presentations.)

 

Finally, do a cfdump of the cookie scope (even in the application.cfc), and especially of the cgi.http_cookie variable. The latter shows what cookies are coming INTO the CF request. Often this will help spot that the problem is not "loss of client vars" but instead "loss of/problems with the cfid/cftoken cookie pair coming in, varying from request to request", which leads cf to associate the request with a new client/session each time. Again there may be settings in cf which influence that, or there can even be influence from the browser used--if you may not be using the same browser to test cf2021 that you'd used for cf11. (If you have been, that doesn't change the rest of what I said.)

 

I hope you'll let us know what you may find. 


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 22, 2023 Aug 22, 2023

Copy link to clipboard

Copied

So, first Charlie  thanks for chiming in. We have worked together before on some things so I appreciate the tips. I certainly didn't know about all of the comparison methods that one could use when looking at the settings. There was one setting that was different in the memory variables section. I did update that and the problem still does exist.

 

So, lets move on to what was requested.

Here is a dump of the cgi.http_cookie on the first line of app.cfc

 

CFID=1202; CFTOKEN=be514c8fb1801904-410D1051-9BC7-6089-8F6F6A87C7BB77CD; JSESSIONID=C3428C80CE2C392E2F6CDC1395A8BD75.cfusion; CFCLIENT_PARKERBUSINESSPLANNING_2021=rolename%3DAdministrator%23dealer%5Fid%3D149%23role%5Fid%3D1%23user%5Fid%3D1%23fullname%3DDavid%20Parker%23; CFGLOBALS=urltoken%3DCFID%23%3D1202%26CFTOKEN%23%3Dbe514c8fb1801904%2D410D1051%2D9BC7%2D6089%2D8F6F6A87C7BB77CD%26jsessionid%23%3DC3428C80CE2C392E2F6CDC1395A8BD75%2Ecfusion%23lastvisit%3D%7Bts%20%272023%2D08%2D22%2021%3A58%3A08%27%7D%23hitcount%3D9%23timecreated%3D%7Bts%20%272023%2D08%2D22%2020%3A55%3A48%27%7D%23cftoken%3Dbe514c8fb1801904%2D410D1051%2D9BC7%2D6089%2D8F6F6A87C7BB77CD%23cfid%3D1202%23

 

and here is a dump of the cookie variable from the same place.

 

App.cfc Dumpe of Cookie and cgi.http_cookieApp.cfc Dumpe of Cookie and cgi.http_cookie

This is a dump from within a file that is trying to find the client variable to make a determination on if it should show something or not.

Like last time, here is the txt of cgi.http_cookie:

CFID=1202; CFTOKEN=be514c8fb1801904-410D1051-9BC7-6089-8F6F6A87C7BB77CD; JSESSIONID=C3428C80CE2C392E2F6CDC1395A8BD75.cfusion; CFCLIENT_PARKERBUSINESSPLANNING_2021=rolename%3DAdministrator%23dealer%5Fid%3D149%23role%5Fid%3D1%23user%5Fid%3D1%23fullname%3DDavid%20Parker%23; CFGLOBALS=urltoken%3DCFID%23%3D1202%26CFTOKEN%23%3Dbe514c8fb1801904%2D410D1051%2D9BC7%2D6089%2D8F6F6A87C7BB77CD%26jsessionid%23%3DC3428C80CE2C392E2F6CDC1395A8BD75%2Ecfusion%23lastvisit%3D%7Bts%20%272023%2D08%2D22%2021%3A58%3A08%27%7D%23hitcount%3D9%23timecreated%3D%7Bts%20%272023%2D08%2D22%2020%3A55%3A48%27%7D%23cftoken%3Dbe514c8fb1801904%2D410D1051%2D9BC7%2D6089%2D8F6F6A87C7BB77CD%23cfid%3D1202%23

 

And now the picture of http_cookie and the dump of cookie Budget list cookie and cgi.JPG

 

So dumping that cookie VAR out I can see the value that I am looking for. ITs role_id which its being compared.

<cfif getDealersByTwentyGroup.recordCount gt 1 AND isdefined("client.role_id") AND client.role_id EQ 1>

When this IF fails, nothing is sent to the screen since there is an AND there it doesn't see client.role_id but we do see

its in the cookie scope.

 

The question I have is why?

 

Looking forward to what you can see from this.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 22, 2023 Aug 22, 2023

Copy link to clipboard

Copied

Show a cfdump of the client scope in these cases. The one you showed originally is different. I'm simply saying show the values in conjunction with this dump of the cookies.

 

Also, you may want to see what clearing cookies (or using new browser) may experience.

 

And are you confirming you have the cf admin default clientsorage set to cookies? Or that your application.cfc/cfm sets it to cookie? 

 

Finally,.you refer to a change you made on the memory variables page of the admin. If it's one of those last few at the bottom, that may also not take effect until current cookies are cleared. 


/Charlie (troubleshooter, carehart.org)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 23, 2023 Aug 23, 2023

Copy link to clipboard

Copied

LATEST

Hi Charlie, 

 

To answer the questions: I did try a new browser I downloaded the results were the same. I also did restat CF after I made those changes. I have confirmed that the client is storing to a cookie. 

Here are the dumps. First in the app.cfc

 

appCFC empty client.JPG

 

Next, this this is the dump with the <cfif> I mentioned above

InisideBudget Client.JPG

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation