diff --git a/workflow/engine/methods/login/authentication.php b/workflow/engine/methods/login/authentication.php index 7f0b6ae4b..3be76821d 100755 --- a/workflow/engine/methods/login/authentication.php +++ b/workflow/engine/methods/login/authentication.php @@ -153,12 +153,6 @@ try { $_SESSION['USR_USERNAME'] = $usr; } - if (PHP_VERSION < 5.2) { - setcookie(session_name(), session_id(), null, '/', '; HttpOnly'); - } else { - setcookie(session_name(), session_id(), null, '/', null, null, true); - } - $aUser = $RBAC->userObj->load($_SESSION['USER_LOGGED']); $RBAC->loadUserRolePermission($RBAC->sSystem, $_SESSION['USER_LOGGED']); //$rol = $RBAC->rolesObj->load($RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_UID']); diff --git a/workflow/public_html/bootstrap.php b/workflow/public_html/bootstrap.php index 33b999057..ec988636c 100755 --- a/workflow/public_html/bootstrap.php +++ b/workflow/public_html/bootstrap.php @@ -54,6 +54,12 @@ require_once PATH_CORE . 'classes' . PATH_SEP . 'class.system.php'; // starting session + $timelife = ini_get('session.gc_maxlifetime'); + if (is_null($timelife)) { + $timelife = 1440; + } + ini_set('session.gc_maxlifetime', $timelife); + ini_set('session.cookie_lifetime', $timelife); session_start(); $config = System::getSystemConfiguration(); @@ -580,6 +586,11 @@ define('SYS_LANG_DIRECTION', $oServerConf->getLanDirection() ); if((isset( $_SESSION['USER_LOGGED'] ))&&(!(isset($_GET['sid'])))) { + if (PHP_VERSION < 5.2) { + setcookie(session_name(), session_id(), time() + $timelife, '/', '; HttpOnly'); + } else { + setcookie(session_name(), session_id(), time() + $timelife, '/', null, false, true); + } $RBAC->initRBAC(); //using optimization with memcache, the user data will be in memcache 8 hours, or until session id goes invalid $memKey = 'rbacSession' . session_id(); @@ -630,6 +641,11 @@ $_SESSION['USER_LOGGED'] = $aUser['USR_UID']; $_SESSION['USR_USERNAME'] = $aUser['USR_USERNAME']; $bRedirect = false; + if (PHP_VERSION < 5.2) { + setcookie(session_name(), session_id(), time() + $timelife, '/', '; HttpOnly'); + } else { + setcookie(session_name(), session_id(), time() + $timelife, '/', null, false, true); + } $RBAC->initRBAC(); $RBAC->loadUserRolePermission( $RBAC->sSystem, $_SESSION['USER_LOGGED'] ); $memKey = 'rbacSession' . session_id(); diff --git a/workflow/public_html/sysGeneric.php b/workflow/public_html/sysGeneric.php index 2ed01fb66..ed8a29902 100755 --- a/workflow/public_html/sysGeneric.php +++ b/workflow/public_html/sysGeneric.php @@ -224,6 +224,12 @@ define( 'PML_UPLOAD_URL', PML_SERVER . '/syspmLibrary/en/green/services/uploadPr define( 'PML_DOWNLOAD_URL', PML_SERVER . '/syspmLibrary/en/green/services/download' ); // starting session +$timelife = ini_get('session.gc_maxlifetime'); +if (is_null($timelife)) { + $timelife = 1440; +} +ini_set('session.gc_maxlifetime', $timelife); +ini_set('session.cookie_lifetime', $timelife); session_start(); $config = Bootstrap::getSystemConfiguration(); @@ -750,6 +756,11 @@ if (! defined( 'EXECUTE_BY_CRON' )) { define( 'SYS_LANG_DIRECTION', $oServerConf->getLanDirection() ); if ((isset( $_SESSION['USER_LOGGED'] )) && (! (isset( $_GET['sid'] )))) { + if (PHP_VERSION < 5.2) { + setcookie(session_name(), session_id(), time() + $timelife, '/', '; HttpOnly'); + } else { + setcookie(session_name(), session_id(), time() + $timelife, '/', null, false, true); + } $RBAC->initRBAC(); //using optimization with memcache, the user data will be in memcache 8 hours, or until session id goes invalid $memKey = 'rbacSession' . session_id(); @@ -797,6 +808,11 @@ if (! defined( 'EXECUTE_BY_CRON' )) { $_SESSION['USER_LOGGED'] = $aUser['USR_UID']; $_SESSION['USR_USERNAME'] = $aUser['USR_USERNAME']; $bRedirect = false; + if (PHP_VERSION < 5.2) { + setcookie(session_name(), session_id(), time() + $timelife, '/', '; HttpOnly'); + } else { + setcookie(session_name(), session_id(), time() + $timelife, '/', null, false, true); + } $RBAC->initRBAC(); $RBAC->loadUserRolePermission( $RBAC->sSystem, $_SESSION['USER_LOGGED'] ); $memKey = 'rbacSession' . session_id();