You are here

public function Session::__construct in Zircon Profile 8.0

Same name in this branch
  1. 8.0 vendor/behat/mink/src/Session.php \Behat\Mink\Session::__construct()
  2. 8.0 vendor/symfony/http-foundation/Session/Session.php \Symfony\Component\HttpFoundation\Session\Session::__construct()
  3. 8.0 core/lib/Drupal/Core/StackMiddleware/Session.php \Drupal\Core\StackMiddleware\Session::__construct()
Same name and namespace in other branches
  1. 8 vendor/symfony/http-foundation/Session/Session.php \Symfony\Component\HttpFoundation\Session\Session::__construct()

Constructor.

Parameters

SessionStorageInterface $storage A SessionStorageInterface instance.:

AttributeBagInterface $attributes An AttributeBagInterface instance, (defaults null for default AttributeBag):

FlashBagInterface $flashes A FlashBagInterface instance (defaults null for default FlashBag):

File

vendor/symfony/http-foundation/Session/Session.php, line 53

Class

Session
Session.

Namespace

Symfony\Component\HttpFoundation\Session

Code

public function __construct(SessionStorageInterface $storage = null, AttributeBagInterface $attributes = null, FlashBagInterface $flashes = null) {
  $this->storage = $storage ?: new NativeSessionStorage();
  $attributes = $attributes ?: new AttributeBag();
  $this->attributeName = $attributes
    ->getName();
  $this
    ->registerBag($attributes);
  $flashes = $flashes ?: new FlashBag();
  $this->flashName = $flashes
    ->getName();
  $this
    ->registerBag($flashes);
}