public function set($name, $value = '', $expire = 0, $path = '/', $domain = '', $secure = false, $httpOnly = false)
    {
        if (!is_string($name)) {
            throw new Cookie\Exception('The cookie name must be string');
        }

        if (!isset($this->cookies[$name])) {
            $this->cookies[$name] = new Cookie($name, $value, $expire, $path, $domain, $secure, $httpOnly);
            $this->cookies[$name]->useEncryption($this->isUsingEncryption());
        } else {
            $this->cookies[$name]->setValue($value)
                ->setExpiration($expire)
                ->setPath($path)
                ->setDomain($domain)
                ->setSecure($secure)
                ->setHttpOnly($httpOnly);
        }

        return $this;
    }