Gets the current session.
SessionNotFoundException
public function getSession() : SessionInterface { if (null !== ($request = end($this->requests) ?: null) && $request->hasSession()) { return $request->getSession(); } throw new SessionNotFoundException(); }