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