public function setSessionAttribute(string $name, $value)
{
if (null === $this->getCurrentRequest() || false === $this->request->hasSession()) {
throw new \LogicException('Cannot set session attributes without valid session.');
}
return $this->request->getSession()->set($name, $value);
}