SessionNotFoundException example


    public function getSession(): SessionInterface
    {
        $session = $this->session;
        if (!$session instanceof SessionInterface && null !== $session) {
            $this->setSession($session = $session());
        }

        if (null === $session) {
            throw new SessionNotFoundException('Session has not been set.');
        }

        return $session;
    }

    /** * Whether the request contains a Session which was started in one of the * previous requests. */
    public function hasPreviousSession(): bool
    {
        

    public function getSession(): SessionInterface
    {
        $session = $this->session;
        if (!$session instanceof SessionInterface && null !== $session) {
            $this->setSession($session = $session());
        }

        if (null === $session) {
            throw new SessionNotFoundException('Session has not been set.');
        }

        return $session;
    }

    /** * Whether the request contains a Session which was started in one of the * previous requests. */
    public function hasPreviousSession(): bool
    {
        
/** * Gets the current session. * * @throws SessionNotFoundException */
    public function getSession(): SessionInterface
    {
        if ((null !== $request = end($this->requests) ?: null) && $request->hasSession()) {
            return $request->getSession();
        }

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

        throw new SessionNotFoundException();
    }
}
Home | Imprint | This part of the site doesn't use cookies.