public function writeCookie() {
        /**
         * When Garp is used from the commandline, writing cookies is impossible.
         * And that's okay.
         */
        if (Zend_Registry::isRegistered('CLI') && Zend_Registry::get('CLI')) {
            return true;
        }

        if (headers_sent($file, $line)) {
            throw new Garp_Store_Exception(
                'Error: headers are already sent, cannot set cookie. ' . "\n" .
                'Output already started at: ' . $file . '::' . $line
            );
        }
        $data = is_array($this->_data) ?
            json_encode($this->_data, JSON_FORCE_OBJECT) :
            $this->_data;
        setcookie(
            $this->_namespace,
            $data,
            time()+$this->_cookieDuration,
            $this->_cookiePath,
            $this->_cookieDomain
        );

        $this->_modified = false;
    }