Bug 48568

Summary: CookieManager broken for AjpSampler
Product: JMeter Reporter: Rainer Jung <rainer.jung>
Component: HTTPAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: normal Keywords: PatchAvailable
Priority: P2    
Version: 2.3.4   
Target Milestone: ---   
Hardware: All   
OS: All   
Attachments: Patch against trunk
Patch against 2.3.4

Description Rainer Jung 2010-01-18 10:03:11 UTC
Created attachment 24855 [details]
Patch against trunk

We noticed two bugs when using the AjpSampler in combination with CookieManager:

A) The cookie header is formatted incorrect and therefore not accepted by the application

B) The cookie information is not passed along to the HTTPSampleResult

Problem A) comes from formatting the cookie via getStringValue(), which returns something like a tab formatted list of the Cookie attributes. You can use a simple JSP or Servlet containing

String cookie=request.getHeader("Cookie");
if (cookie != null) {
    out.println("Cookie: " + cookie);
}

to verify this. The fix consists in using an actual Cookie object instead of a generic JMeterProperty and then retrieving Cookie name and value via getName() and getValue().

Problem B) is fixed by calling res.setCookies().

See the atahced patches.

Thanks for the great Apache JMeter software!
Comment 1 Rainer Jung 2010-01-18 10:04:02 UTC
Created attachment 24856 [details]
Patch against 2.3.4
Comment 2 Sebb 2010-01-18 17:19:01 UTC
Good catch, thanks!


URL: http://svn.apache.org/viewvc?rev=900635&view=rev
Log:
Bug 48568 - CookieManager broken for AjpSampler