$userInfo['username'], 'secret' => sha1($userInfo['password']), 'master_domain' => $chamiloUrl, 'master_auth_uri' => $chamiloUrl.'?submitAuth=true', 'lifetime' => time() + 3600, 'target' => $refererSso, ]; if (!empty($additionalParams)) { foreach ($additionalParams as $key => $value) { if (!empty($key)) { $sso[$key] = $value; continue; } $sso[] = $value; } } $cookie = base64_encode(serialize($sso)); return $refererSso .($getParams ? '&' : '?') .http_build_query([ 'loginFailed' => 0, 'sso_referer' => $refererSso, 'sso_cookie' => $cookie, ]); } }