Commit 12179e3b authored by akalam's avatar akalam

Start session for anonymous users

parent 8b28c829
......@@ -240,10 +240,12 @@ function node_authlink_node_access(NodeInterface $node, $op, AccountInterface $a
if ($node->authkey == $_GET['authkey']) {
// Start session
if (!isset($_SESSION)) /** @var \Drupal\Core\Session\SessionManager $session_manager */ {
if ($account->isAnonymous() && !isset($_SESSION['node_authlink_nodes'])) {
/** @var \Drupal\Core\Session\SessionManager $session_manager */
$session_manager = \Drupal::service('session_manager');
$session_manager->start();
}
$session_manager->start();
// Save allowed grants to session
$config_grants = $config->get('grants');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment