diff --git a/main/inc/lib/main_api.lib.php b/main/inc/lib/main_api.lib.php index fbe898a5e5..69456320ca 100644 --- a/main/inc/lib/main_api.lib.php +++ b/main/inc/lib/main_api.lib.php @@ -910,7 +910,7 @@ function api_get_anonymous_id() { * Returns the cidreq parameter name + current course id */ function api_get_cidreq() { - return empty($GLOBALS['_cid']) ? '' : 'cidReq='.htmlspecialchars($GLOBALS['_cid']); + return empty($GLOBALS['_cid']) ? '' : 'cidReq='.htmlspecialchars($GLOBALS['_cid']).(api_get_session_id()==0?'':'&session_id='.api_get_session_id()); } /** diff --git a/main/inc/local.inc.php b/main/inc/local.inc.php index b7e3056931..2b1ba6eaba 100644 --- a/main/inc/local.inc.php +++ b/main/inc/local.inc.php @@ -841,9 +841,7 @@ if (isset($cidReset) && $cidReset) { // course session data refresh requested or } else { $_cid = $_SESSION['_cid' ]; $_course = $_SESSION['_course']; - if ($_cid != '') { - $cidReset = true; // force the user validation - } + // these lines are usefull for tracking. Indeed we can have lost the id_session and not the cid. // Moreover, if we want to track a course with another session it can be usefull if (!empty($_GET['id_session'])) { @@ -995,7 +993,7 @@ if ((isset($uidReset) && $uidReset) || (isset($cidReset) && $cidReset)) { // ses $is_courseAdmin = false; } api_session_register('_courseUser'); - } else { + } else { if (api_get_session_id() != 0) { // Check if the user is a student is this session $sql = "SELECT * FROM ".$tbl_session_course_user."