Issue : CookieEncoder quoted String

ekefly jinjian.1 at gmail.com
Wed Oct 19 03:55:45 EDT 2011


Hi

let's take google as example, i get a cookie value below from
www.google.com's set-cookie, I parsed it and check and then set it back.


String cookievalue =
"PREF=ID=5184005bfd8303ea:FF=0:TM=1319007383:LM=1319007384:S=FUDOk691GhnkEWNj;
expires=Fri, 18-Oct-2013 06:56:24 GMT; path=/; domain=.google.com";
		YottaaCookieDecoder decoder = new YottaaCookieDecoder();
		CookieEncoder encoder = new CookieEncoder(true);
		Set<Cookie> cookies = decoder.decode(cookievalue);
		for(Cookie c : cookies){
			encoder.addCookie(c);
			System.out.println(c.getValue());
		}
		System.out.println(encoder.encode());
OutPut:
ID=5184005bfd8303ea:FF=0:TM=1319007383:LM=1319007384:S=FUDOk691GhnkEWNj
PREF=*"ID=5184005bfd8303ea:FF=0:TM=1319007383:LM=1319007384:S=FUDOk691GhnkEWNj"*;Expires=Fri,
18-Oct-13 06:56:24 GMT;Path=/;Domain=.google.com

The new cookie's value was quoted. But this cookie is unrecognized by
google, and google set this cookie again and again.

--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Issue-CookieEncoder-quoted-String-tp6907623p6907623.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list