diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 0dc12c468c8..01e112652b8 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -141,6 +141,10 @@ if (! defined('NOREQUIREDB')) { $conf->entity = DOLENTITY; } + else if (!empty($_COOKIE['DOLENTITY'])) // For other application with MultiCompany module + { + $conf->entity = $_COOKIE['DOLENTITY']; + } else if (! empty($conf->multicompany->force_entity) && is_int($conf->multicompany->force_entity)) // To force entity in login page { $conf->entity = $conf->multicompany->force_entity;