@Override
    public String getFieldValue()
    {
        String name = this.getName();

        if (name.trim().equals("")) {
            return "";
        }

        String fieldValue = "";
        String value = this.getValue();

        if (this.encodeValue) {
            try {
                value = URLEncoder.encode(value, "UTF-8");
            } catch (UnsupportedEncodingException e) {
            }
        }

        fieldValue = name + '=' + value
                   + "; Version=1";

        if (this.getMaxAge() > 0) {
            fieldValue += "; Max-Age=" + this.getMaxAge();
        }

        if (this.getExpires() != null) {
            fieldValue += "; Expires=" + (new SimpleDateFormat("EEE, dd-MM-yy HH:mm:ss Z")).format(this.getExpires());
        }

        if (this.getDomain() != null) {
            fieldValue += "; Domain=" + this.getDomain();
        }

        if (this.getPath() != null) {
            fieldValue += "; Path=" + this.getPath();
        }

        if (this.isSecure()) {
            fieldValue += "; Secure";
        }

        if (this.isHttpOnly()) {
            fieldValue += "; HttpOnly";
        }

        return fieldValue;
    }