Bad value for cookie name

This commit is contained in:
Laurent Destailleur 2010-01-12 10:53:14 +00:00
parent b093d6499b
commit 7eaf1f8e9f
2 changed files with 4 additions and 4 deletions

View File

@ -34,7 +34,7 @@ if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
set_include_path($_SERVER['DOCUMENT_ROOT'].'/htdocs'); set_include_path($_SERVER['DOCUMENT_ROOT'].'/htdocs');
// Retrieve the entity in the cookie // Retrieve the entity in the cookie
$entityCookieName = "DOLENTITYID_dolibarr"; $entityCookieName = "DOLENTITYID_".md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]);
if (isset($_COOKIE[$entityCookieName])) $_SESSION["dol_entity"] = $_COOKIE[$entityCookieName]; if (isset($_COOKIE[$entityCookieName])) $_SESSION["dol_entity"] = $_COOKIE[$entityCookieName];
require('master.inc.php'); require('master.inc.php');

View File

@ -230,7 +230,7 @@ class modMultiCompany extends DolibarrModules
function destroy_cookie() function destroy_cookie()
{ {
// Destroy entity cookie // Destroy entity cookie
$entityCookieName = "DOLENTITYID_dolibarr"; $entityCookieName = "DOLENTITYID_".md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]);
setcookie($entityCookieName, '', 1, "/"); setcookie($entityCookieName, '', 1, "/");
} }
} }