costin      2003/01/20 10:38:50

  Modified:    catalina/src/share/org/apache/catalina/util CookieTools.java
  Log:
  Add an extra space after ; in cookies.
  
  This avoids problems with some IE/Mac versions, and makes the
  cookies closer to the examples in the spec ( which include the space )
  
  Revision  Changes    Path
  1.8       +11 -11    
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/CookieTools.java
  
  Index: CookieTools.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/util/CookieTools.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- CookieTools.java  21 Feb 2002 22:51:55 -0000      1.7
  +++ CookieTools.java  20 Jan 2003 18:38:50 -0000      1.8
  @@ -122,11 +122,11 @@
           // add version 1 specific information
           if (version == 1) {
               // Version=1 ... required
  -            buf.append (";Version=1");
  +            buf.append ("; Version=1");
   
               // Comment=comment
               if (cookie.getComment() != null) {
  -                buf.append (";Comment=");
  +                buf.append ("; Comment=");
                   maybeQuote (version, buf, cookie.getComment());
               }
           }
  @@ -134,14 +134,14 @@
           // add domain information, if present
   
           if (cookie.getDomain() != null) {
  -            buf.append(";Domain=");
  +            buf.append("; Domain=");
               maybeQuote (version, buf, cookie.getDomain());
           }
   
           // Max-Age=secs/Discard ... or use old "Expires" format
           if (cookie.getMaxAge() >= 0) {
               if (version == 0) {
  -                buf.append (";Expires=");
  +                buf.append ("; Expires=");
                   if (cookie.getMaxAge() == 0)
                       DateTool.oldCookieFormat.format(new Date(10000), buf,
                                                       new FieldPosition(0));
  @@ -151,21 +151,21 @@
                                      cookie.getMaxAge() *1000L), buf,
                            new FieldPosition(0));
               } else {
  -                buf.append (";Max-Age=");
  +                buf.append ("; Max-Age=");
                   buf.append (cookie.getMaxAge());
               }
           } else if (version == 1)
  -          buf.append (";Discard");
  +          buf.append ("; Discard");
   
           // Path=path
           if (cookie.getPath() != null) {
  -            buf.append (";Path=");
  +            buf.append ("; Path=");
               maybeQuote (version, buf, cookie.getPath());
           }
   
           // Secure
           if (cookie.getSecure()) {
  -          buf.append (";Secure");
  +          buf.append ("; Secure");
           }
       }
   
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to