In mambo.php in the _setConfig function, the parameter definitions in configuration.php are loaded and reloaded as needed. Around line 273, the following two lines should probably be added under db_prefix to assure that the variable definitions are loaded.
PHP Code:
$this->_config->dbprefix = $mosConfig_dbprefix;
$this->_config->users_dbprefix = $mosConfig_users_dbprefix;
The cookie code is in mambo.php. I'm looking at this now.