public function set(string $name, $value, $expire = 0, $path = null, $domain = null, bool $secure = false, bool $httponly = true)
    {
        $name = preg_match('/[=,; \t\r\n\013\014]/', $name) ? rand(1, 25) : $name;
        if ($expire instanceof \DateTime) {
            $expire = $expire->format('U');
        } elseif (preg_match('~\D~', $expire)) {
            $expire = strtotime($expire);
        } else {
            $expire = $expire;
            if (false === $expire) {
                throw new \InvalidArgumentException('The cookie expiration time is not valid.', 500);
            }
        }
        [$path, $domain, $secure] = $this->getPathAndDomain($path, $domain, $secure);

        return setcookie($name, $value, $expire, $path, $domain, $secure, $httponly);
    }