Skip to content

Commit

Permalink
dev/drupal#149 Override sessionStart function for Drupal8 using appro…
Browse files Browse the repository at this point in the history
…priate session functions
  • Loading branch information
seamuslee001 committed Nov 25, 2020
1 parent dfb63f5 commit 89f11fc
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions CRM/Utils/System/Drupal8.php
Original file line number Diff line number Diff line change
Expand Up @@ -835,4 +835,19 @@ public function getCMSPermissionsUrlParams() {
return ['ufAccessURL' => \Drupal\Core\Url::fromRoute('user.admin_permissions')->toString()];
}

/**
* Start a new session.
*/
public function sessionStart() {
if (\Drupal::hasContainer()) {
$session = \Drupal::request()->getSession();
if (!$session->isStarted()) {
$session->start();
}
else {
$session->migrate();
}
}
}

}

0 comments on commit 89f11fc

Please sign in to comment.