public function get($name = null)
    {
        if (is_null($name)) {
            $name = $this->security->sanitize($this->name);
        }

        $name = $this->security->sanitize($name);

        if (!isset(static::$cookies[$name])) {
            throw new InvalidCookieException('Cookie '.$name.' not found');
        }

        if (isset(static::$cookies[$name])) {
            if (is_array(static::$cookies[$name])) {
                return json_decode(static::$cookies[$name]);
            }

            return $this->security->sanitize(static::$cookies[$name]);
        }
    }