/** * This takes the number of seconds the cookie will live * for. In order for this to be respected by older browsers * such as IE-5.0 to IE-9.0 this must return a string in * the original cookie specification by Netscape. * * @param seconds the number of seconds from now * * @return a date formatted for used with old browsers */ public String format(int seconds) { Calendar calendar = Calendar.getInstance(zone); Date date = convert(seconds); calendar.setTime(date); format.setCalendar(calendar); return format.format(date); }
version +(path ==null ?"":"; path="+path)+ (domain ==null ?"": "; domain="+domain)+ (expiry< 0?"":"; expires="+date.format(expiry))+ (expiry < 0 ? "" : "; max-age="+expiry)+ (secure ? "; secure" : "") +
version +(path ==null ?"":"; path="+path)+ (domain ==null ?"": "; domain="+domain)+ (expiry< 0?"":"; expires="+date.format(expiry))+ (expiry < 0 ? "" : "; max-age="+expiry)+ (secure ? "; secure" : "") +
version +(path ==null ?"":"; path="+path)+ (domain ==null ?"": "; domain="+domain)+ (expiry< 0?"":"; expires="+date.format(expiry))+ (expiry < 0 ? "" : "; max-age="+expiry)+ (secure ? "; secure" : "") +
/** * Constructor of the <code>Cookie</code> that uses a default * version of 1, which is used by RFC 2109. This allows the * path attribute to be specified for on construction. Other * attributes can be set using the set methods provided. * <p> * The name must conform to RFC 2109, which means that it can * contain only ASCII alphanumeric characters and cannot have * commas, white space, or semicolon characters. * * @param name this is the name of this cookie instance * @param value this is the value of this cookie instance * @param path the path attribute of this cookie instance * @param created this determines if the cookie is new */ public Cookie(String name, String value, String path, boolean created) { this.date = new CookieDate(); this.created = created; this.value = value; this.name = name; this.path = path; this.version = 1; this.expiry = -1; }
/** * Constructor of the <code>Cookie</code> that uses a default * version of 1, which is used by RFC 2109. This allows the * path attribute to be specified for on construction. Other * attributes can be set using the set methods provided. * <p> * The name must conform to RFC 2109, which means that it can * contain only ASCII alphanumeric characters and cannot have * commas, white space, or semicolon characters. * * @param name this is the name of this cookie instance * @param value this is the value of this cookie instance * @param path the path attribute of this cookie instance * @param created this determines if the cookie is new */ public Cookie(String name, String value, String path, boolean created) { this.date = new CookieDate(); this.created = created; this.value = value; this.name = name; this.path = path; this.version = 1; this.expiry = -1; }
/** * Constructor of the <code>Cookie</code> that uses a default * version of 1, which is used by RFC 2109. This allows the * path attribute to be specified for on construction. Other * attributes can be set using the set methods provided. * <p> * The name must conform to RFC 2109, which means that it can * contain only ASCII alphanumeric characters and cannot have * commas, white space, or semicolon characters. * * @param name this is the name of this cookie instance * @param value this is the value of this cookie instance * @param path the path attribute of this cookie instance * @param created this determines if the cookie is new */ public Cookie(String name, String value, String path, boolean created) { this.date = new CookieDate(); this.created = created; this.value = value; this.name = name; this.path = path; this.version = 1; this.expiry = -1; }
/** * This takes the number of seconds the cookie will live * for. In order for this to be respected by older browsers * such as IE-5.0 to IE-9.0 this must return a string in * the original cookie specification by Netscape. * * @param seconds the number of seconds from now * * @return a date formatted for used with old browsers */ public String format(int seconds) { Calendar calendar = Calendar.getInstance(zone); Date date = convert(seconds); calendar.setTime(date); format.setCalendar(calendar); return format.format(date); }
/** * This takes the number of seconds the cookie will live * for. In order for this to be respected by older browsers * such as IE-5.0 to IE-9.0 this must return a string in * the original cookie specification by Netscape. * * @param seconds the number of seconds from now * * @return a date formatted for used with old browsers */ public String format(int seconds) { Calendar calendar = Calendar.getInstance(zone); Date date = convert(seconds); calendar.setTime(date); format.setCalendar(calendar); return format.format(date); }