function WriteSafeSessionHandler::__construct

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Session/WriteSafeSessionHandler.php \Drupal\Core\Session\WriteSafeSessionHandler::__construct()
  2. 10 core/lib/Drupal/Core/Session/WriteSafeSessionHandler.php \Drupal\Core\Session\WriteSafeSessionHandler::__construct()
  3. 9 core/lib/Drupal/Core/Session/WriteSafeSessionHandler.php \Drupal\Core\Session\WriteSafeSessionHandler::__construct()
  4. 8.9.x core/lib/Drupal/Core/Session/WriteSafeSessionHandler.php \Drupal\Core\Session\WriteSafeSessionHandler::__construct()

Constructs a new write safe session handler.

Parameters

\SessionHandlerInterface $handler: The underlying session handler.

bool $sessionWritable: Whether or not the session should be initially writable.

File

core/lib/Drupal/Core/Session/WriteSafeSessionHandler.php, line 28

Class

WriteSafeSessionHandler
Wraps the session handler to prevent writes when not necessary or allowed.

Namespace

Drupal\Core\Session

Code

public function __construct(\SessionHandlerInterface $handler, protected $sessionWritable = TRUE) {
  parent::__construct($handler);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.