Skip to content
Snippets Groups Projects
Commit 671f655b authored by eileen's avatar eileen
Browse files

[REF] move sessionStart functionality to System subclass

parent d7fbd134
Branches
Tags
No related merge requests found
......@@ -108,17 +108,7 @@ class CRM_Core_Session {
if ($isRead) {
return;
}
// FIXME: This belongs in CRM_Utils_System_*
if (CRM_Core_Config::singleton()->userSystem->is_drupal && function_exists('drupal_session_start')) {
// https://issues.civicrm.org/jira/browse/CRM-14356
if (!(isset($GLOBALS['lazy_session']) && $GLOBALS['lazy_session'] == TRUE)) {
drupal_session_start();
}
$_SESSION = [];
}
else {
session_start();
}
CRM_Core_Config::singleton()->userSystem->sessionStart();
}
$this->_session =& $_SESSION;
}
......
......@@ -974,4 +974,11 @@ abstract class CRM_Utils_System_Base {
CRM_Utils_System::civiExit();
}
/**
* Start a new session.
*/
public function sessionStart() {
session_start();
}
}
......@@ -13,8 +13,6 @@
*
* @package CRM
* @copyright CiviCRM LLC https://civicrm.org/licensing
* $Id$
*
*/
/**
......@@ -667,4 +665,20 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base {
return FALSE;
}
/**
* Start a new session.
*/
public function sessionStart() {
if (function_exists('drupal_session_start')) {
// https://issues.civicrm.org/jira/browse/CRM-14356
if (!(isset($GLOBALS['lazy_session']) && $GLOBALS['lazy_session'] == TRUE)) {
drupal_session_start();
}
$_SESSION = [];
}
else {
session_start();
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment