Config.inc.php file settings

I’m curious about what these settings actually do and what they are used for.

Presumably they’re generated on setup - so if I’m cloning a site to use on another domain - what should be done with these?

$site_id = 'modx1234567890123.1234567';
$site_sessionname = 'SN1234567890123';
$uuid = '12345678-1234-1234-1234-12345678901';

Thanks in advance.

1 Like

sad-pablo-lonely

1 Like

The $site_id is part of what generates your session tokens - an internal security mechanism used predominantly in the manager (aka modauth), though that could potentialy also be used in front-end scenarios with logged-in users.

I don’t think $site_sessionname is in use. That may have predated the session_name system setting.

The $uuid is supposed to be a globally unique identifier for the MODX site. It is passed to package providers which could in theory use it for licensing or other sorts of tracking. I don’t think any public package providers rely on that, though.

Letting new values be generated for them, especially the site_id, would be recommended but it’s not an immediate problem if they’re reused on a cloned site.

Hey @markh

Thanks for the reply :+1:

When would new values be generated? During setup?

When cloning a site though - I don’t generally run setup - should I? I normally just configure the config files etc myself.

Or maybe I should just look into mangling these values a little myself too?

Thanks again

Yeah typically they’re generated for you during the setup. I’m not 100% sure it’ll change them after running setup on a cloned site, though. I think it’s meant to keep them constant for a given site.

Running setup after a migration or clone is a good practice because it’ll flag any issues with the database or file system, but if you’re confident in your process it’s fine not to do it :slight_smile:

Doesn’t hurt, but not a big deal if you don’t. For the UUID make sure you keep the format consistent, in case that gets any future use that expects the UUID format. :wink:

1 Like

Thanks as ever @markh … have a good weekend!

1 Like

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.