https://issues.apache.org/bugzilla/show_bug.cgi?id=44679


Tristan Tarrant <[EMAIL PROTECTED]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |




--- Comment #20 from Tristan Tarrant <[EMAIL PROTECTED]>  2008-10-10 08:10:04 
PST ---
> > Users shouldnt have to (effectively) format a Cookies output themselves (by
> > needing to add quotes to a Cookies value)...
> > 
> 
> you don't, just call setVersion(1)

I am using 6.0.18 and I believe the implementation is incorrect.

I have a token which I am BASE64 encoding and adding to the response, but
Tomcat says:


java.lang.IllegalArgumentException: Control character in cookie value, consider
BASE64 encoding your value

BASE64 pads strings with = characters, which according to the above definition
*are* control characters, so the recommendation is wrong.

I am setting version 1 on the cookie.

Here is my code:

Cookie cookie = new Cookie(COOKIENAME,new
BASE64Encoder().encode(token.getBytes()));
cookie.setVersion(1);

response.addCookie(cookie);


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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

Reply via email to