doDestroy example

protected function doWrite(#[\SensitiveParameter] string $sessionId, string $data): bool     {
        return $this->handler->write($sessionId$data);
    }

    public function destroy(#[\SensitiveParameter] string $sessionId): bool     {
        $this->doDestroy = true;
        $destroyed = parent::destroy($sessionId);

        return $this->doDestroy ? $this->doDestroy($sessionId) : $destroyed;
    }

    protected function doDestroy(#[\SensitiveParameter] string $sessionId): bool     {
        $this->doDestroy = false;

        return $this->handler->destroy($sessionId);
    }

    public function close(): bool
    {
        

            if (null === $cookie || isset($_COOKIE[$this->sessionName])) {
                $params = session_get_cookie_params();
                unset($params['lifetime']);
                setcookie($this->sessionName, '', $params);
            }
        }

        return $this->newSessionId === $sessionId || $this->doDestroy($sessionId);
    }
}
protected function doWrite(#[\SensitiveParameter] string $sessionId, string $data): bool     {
        return $this->handler->write($sessionId$data);
    }

    public function destroy(#[\SensitiveParameter] string $sessionId): bool     {
        $this->doDestroy = true;
        $destroyed = parent::destroy($sessionId);

        return $this->doDestroy ? $this->doDestroy($sessionId) : $destroyed;
    }

    protected function doDestroy(#[\SensitiveParameter] string $sessionId): bool     {
        $this->doDestroy = false;

        return $this->handler->destroy($sessionId);
    }

    public function close(): bool
    {
        

            if (null === $cookie || isset($_COOKIE[$this->sessionName])) {
                $params = session_get_cookie_params();
                unset($params['lifetime']);
                setcookie($this->sessionName, '', $params);
            }
        }

        return $this->newSessionId === $sessionId || $this->doDestroy($sessionId);
    }
}
Home | Imprint | This part of the site doesn't use cookies.