Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. NativeSessionStorage.php

function NativeSessionStorage::getBag

Overrides SessionStorageInterface::getBag

File

vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php, line 273

Class

NativeSessionStorage
This provides a base class for session attribute storage.

Namespace

Symfony\Component\HttpFoundation\Session\Storage

Code

public function getBag(string $name) : SessionBagInterface {
    if (!isset($this->bags[$name])) {
        throw new \InvalidArgumentException(\sprintf('The SessionBagInterface "%s" is not registered.', $name));
    }
    if (!$this->started && $this->saveHandler
        ->isActive()) {
        $this->loadSession();
    }
    elseif (!$this->started) {
        $this->start();
    }
    return $this->bags[$name];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal