From ee784452f0e516a400a215414d766fc6e4909bd7 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@users.sourceforge.net>
Date: Thu, 30 Dec 2010 22:54:11 +0000
Subject: [PATCH] Fix: Can have one system dir for two virtual servers or two
 instances in same system dir.

---
 htdocs/lib/functions.lib.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php
index dcb0ff51c71..a99550232f0 100644
--- a/htdocs/lib/functions.lib.php
+++ b/htdocs/lib/functions.lib.php
@@ -66,13 +66,13 @@ function GETPOST($paramname,$check='',$method=0)
 
 /**
  *  Return a prefix to use for this Dolibarr instance for session or cookie names.
- *  This prefix is unique for instance and avoid conflict between multi-instances Dolibarrs.
+ *  This prefix is unique for instance and avoid conflict between multi-instances Dolibarrs,
+ *  even when having two instances with one root dir or two instances in virtual servers.
  *  @return         string      A calculated prefix
  */
 function dol_getprefix()
 {
-    //print  "prefix=".$_SERVER["SERVER_NAME"]."-".$_SERVER["DOCUMENT_ROOT"]."-".DOL_DOCUMENT_ROOT;
-    return md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].DOL_DOCUMENT_ROOT);
+    return md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].DOL_DOCUMENT_ROOT.DOL_URL_ROOT);
 }
 
 /**
-- 
GitLab