Is there a way to dump admin / configuration values?

Hello Fellow Lucee-ites, I am having issues that I suspect are due to subtle configuration differences between a few sites / contexts and would like to dump the values of all admin settings programmatically.

I am aware I can do this:
admin=new Administrator(“web”,“password”);
Which gets all the methods, but that’s not what I’m after.

Also I believe one could compare lucee-server.xml’s and/or lucee-web.xml’s… which would be very inconvenient. And BTW do these files contain ALL settings?

How do I get what all the settings are set to with script? Is it possible?

Thanks H,

OS: CentOS Linux 7.9
Java Version: 1.8.0_181
Tomcat Version :Apache Tomcat/8.5.14
Lucee Version: ( I know. It’s the hand that was dealt)

Have you tried the following?


Another, maybe better alternative would be to get/export the settings with CommandBox cfconfig..

1 Like

Thanks andreas, that does indeed work but does not seem complete. I currently know nothing about commandbox. Is there a reference that excels at Commandbox cfconfig?

I have however been digging and it seems I may be barking up the entirely wrong tree.

The primary issue seems to be losing the entire session scope after an ajax callback. location.replace reloading the page. I guess since it’s javascript making the request, not the browser itself, the session is not preserved? How can I send the session with the callback request.

This is far removed from the original question. Maybe I should start another topic… as soon as I can get to a real keyboard

This is a set of questions…

What is what you are looking for?

Still, we need to know what you are looking for or what you you need to have. What results are you getting? What results are you expecting? What information you want to get exactly from your application?

Another alternative would be to use:

  • cfadmin (I think it’s not fully supported, but should just work), or
  • Administrator.cfc, which still needs some documentation

However, tell us what you want to know an what you are looking for, and we might give you a better advice.

This is another question. Are you looking for your application settings to see if your ajax endpoint location has session management enabled?

Usually you don’t need to do anything, as soon as the browser gets the session cookies. If it gets the session cookies in the server response, it will send the session cookie automatically all along with the subsequent ajax request. No additional code needed.

If you are loosing the session, check the following (best to be verified within your browsers dev tool through the network tab)

  • is your server sending the session cookie in the server response header?
  • is your browser sending the cookies to the ajax endpoint?
  • do your cookies have certain attributes set, that might block your browser from re-sending cookies, e.g. “https only”, “sameSite” or similar?
  • are there any browser warnings in the console, like CORS warnings or similar hints?

Of course, you need to make sure first, that the session/client management (in your application.cfc or server/web administrator) is enabled.

You can use CFConfig to export a JSON dump of all your CF config stored in the admin UI, even for non-CommandBox servers. You can also directly diff two servers and see all config differences.

Thanks for the wisdom andreas. Your questions are well received. For now, I used the classic work-around to be able to defer this issue until I have the time to address it properly. Since ajax requests should retain the session scope, I really need to do some homework to give decent answers.

Watch this space for updates sometime soon

This is exactly what I need to find out what’s going on! …technically the best solution to my original question about comparing configs. As to why the session scope disappears, that’s another matter. Hoping CFConfig compare makes it obvious. Thanks

What’s missing / incomplete?

This is probably related to cookies being mishandled. Not saying you shouldn’t go down the path of comparing configs, but I’m not sure you’ll find the answer there. There were actually some bugs in recent versions of Lucee that specifically affected the way cookies were parsed on some servlets, leading to loss of sessions. You mentioned you’re using Lucee, but are you sure all servers are on that exact same version?

Thx for your reply. It looks like session and client management are on and stored in a mysql db. There seems to be a lot more stuff in the admin than in the getApplicationSettings dump. Nothing specific

Hi, Yep the lucee version is the same. I have a plethora of items to check on thanks to everybody that has responded. I need to supply some answers. Super busy time for me at the moment. This should be interesting. More info as I gather it.
Thx again