tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robin Meade <rme...@outreach.hawaii.edu>
Subject Cookie expiration time zone
Date Tue, 07 Dec 1999 09:43:45 GMT
The header Tomcat sends for setting version 0 cookies with expiration times
contains the locale time zone. It should be GST.

Example:
HeaderName = Set-Cookie
HeaderValue = name5=value5;Expires=Tue, 07-Dec-1999 09:09:55 HST


Here is a fix:

In file /org/apache/tomcat/util/CookieTools.java:

In class OldCookieExpiry:

void append (StringBuffer buf) {
    String pattern = "EEE, dd-MMM-yyyyy HH:mm:ss z";
    Locale loc = Locale.US;
    SimpleDateFormat df = new SimpleDateFormat(pattern, loc);
    
    /* Begin Patch */
    /* Add these 2 lines */
    TimeZone zone = TimeZone.getTimeZone("GMT");
    df.setTimeZone(zone);
    /* End Patch */
      
    String str = df.format(calendar.getTime());
    buf.append(str);
}

Mime
View raw message