[Webtest] Comma character NOT allowed in a cookie value?

Mircea Cocosila Mircea Cocosila" <mircea@neodonis.com
Mon, 28 Jul 2008 11:53:19 -0400


------=_Part_16731_30122193.1217260399738
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi,

I'm using WebTest to test a web application and I have a problem. Not sure
if it's a bug in webtest itself or some special configuration should be
used.

I'm watching the cookies that are received by webtest. I expect a cookie
like this:

CTMBR=29990,Test,Van Auken,opNonElite,CPP

but webtest parses multiple cookies instead like

Cookie accepted: "CTMBR=29990"
Cookie accepted: "Test="
Cookie accepted: "Van Auken="
Cookie accepted: "opNonElite="
Cookie accepted: "CPP="

It seems that webtest interprets comma (",") as a separator among multiple
cookies.

I've read most of the posts in the mailing list and didn't find something to
solve my problem. I tried all the cookie policies: BROWSER_COMPATIBILITY,
NETSCAPE, RFC_2109, and RFC_2965. Changing cookie policy didn't make any
difference.

I configured the cookie policy using a groovy step found in the mailing
list:

            <groovy description="Change cookie policy to:
BROWSER_COMPATIBILITY">
              import org.apache.commons.httpclient.cookie.CookiePolicy
              import org.apache.commons.httpclient.params.*


((HttpClientParams)DefaultHttpParams.getDefaultParams()).setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);
            </groovy>

Any help would be highly appreciated.

Thanks a lot,
Mircea

------=_Part_16731_30122193.1217260399738
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

<div dir="ltr">Hi,<br><br>I&#39;m using WebTest to test a web application and I have a problem. Not sure if it&#39;s a bug in webtest itself or some special configuration should be used.<br><br>I&#39;m watching the cookies that are received by webtest. I expect a cookie like this:<br>
<br>CTMBR=29990,Test,Van Auken,opNonElite,CPP<br><br>but webtest parses multiple cookies instead like<br><br>Cookie accepted: &quot;CTMBR=29990&quot;<br>Cookie accepted: &quot;Test=&quot;<br>Cookie accepted: &quot;Van Auken=&quot;<br>
Cookie accepted: &quot;opNonElite=&quot;<br>Cookie accepted: &quot;CPP=&quot;<br><br>It seems that webtest interprets comma (&quot;,&quot;) as a separator among multiple cookies.<br><br>I&#39;ve read most of the posts in the mailing list and didn&#39;t find something to solve my problem. I tried all the cookie policies: BROWSER_COMPATIBILITY, NETSCAPE, RFC_2109, and RFC_2965. Changing cookie policy didn&#39;t make any difference.<br>
<br>I configured the cookie policy using a groovy step found in the mailing list:<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;groovy description=&quot;Change cookie policy to: BROWSER_COMPATIBILITY&quot;&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; import org.apache.commons.httpclient.cookie.CookiePolicy<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; import org.apache.commons.httpclient.params.*<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; ((HttpClientParams)DefaultHttpParams.getDefaultParams()).setCookiePolicy(CookiePolicy.BROWSER_COMPATIBILITY);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/groovy&gt;<br>
<br>Any help would be highly appreciated.<br><br>Thanks a lot,<br>Mircea<br></div>

------=_Part_16731_30122193.1217260399738--