public function cookie($name = null, $default = null, $type = null)
    {
        $cookie = $this->request['cookie'];
        gplcart_array_trim($cookie, true);

        if (isset($name)) {
            $return = isset($cookie[$name]) ? $cookie[$name] : $default;
        } else {
            $return = $cookie;
        }

        gplcart_settype($return, $type, $default);
        return $return;
    }