Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev/drupal#98 Fix masquerade issue caused by drupal update change #16177

Merged
merged 1 commit into from
Jan 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CRM/Core/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ class CRM_Core_Session {
*/
protected $_session = NULL;

/**
* Current php Session ID : needed to detect if the session is changed
*
* @var string
*/
protected $sessionID;

/**
* We only need one instance of this object. So we use the singleton
* pattern and cache the instance in this variable
Expand Down Expand Up @@ -88,6 +95,11 @@ public static function &singleton() {
* Is this a read operation, in this case, the session will not be touched.
*/
public function initialize($isRead = FALSE) {
// remove $_SESSION reference if session is changed
if (($sid = session_id()) !== $this->sessionID) {
$this->_session = NULL;
$this->sessionID = $sid;
}
// lets initialize the _session variable just before we need it
// hopefully any bootstrapping code will actually load the session from the CMS
if (!isset($this->_session)) {
Expand Down