When extracted from an XML document, the jsessionid value might contains extra characters. For example, with this XML : "<url>/some/path;jsessionid=123456789</url>", the extracted jsessionid is "123456789</url". The attached patch fixes the problem by excluding the "<" character from the list of allowed characters for a jsessionid value.
Created attachment 26305 [details] Patch
Thanks for report and patch. Done in SVN URL: http://svn.apache.org/viewvc?rev=1037021&view=rev Log: Bug 50286 - URL Re-writing Modifier: extracted jsessionid value is incorrect when is between XML tags Modified: jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/modifier/URLRewritingModifier.java jakarta/jmeter/trunk/xdocs/changes.xml
I'm not sure this is fully solved. At least there needs to be a test case. So I wrote a test case - but it failed because it does not use any of the REs that have been patched. Instead it uses parameterRegexp. @Gregory: Does your test use Path Extension = true? Not sure how that could be using that for the example you gave.
(In reply to comment #3) > Not sure how that could be using that for the example you gave. Scrub that sentence - does not apply.
The solve wouldn't be adding a < in parameterRegexp? parameterRegexp = JMeterUtils.getPatternCache().getPattern( // ;sessionid=value "[;\\?&]" + quotedArg + "=([^\"'>&\\s;\\\\]*)" + // $NON-NLS-1$
(In reply to comment #3) > @Gregory: Does your test use Path Extension = true? yes, my test uses PathExtension=true and PathExtensionNoQuestionmark=true
(In reply to comment #5) > The solve wouldn't be adding a < in parameterRegexp? My patch solves the problem in my case (PathExtension=true). The same problem may exists as well in the "PathExtension=false" case, I didn't checked.
Thanks for confirming your settings. Code has now also been fixed for the PathExtension=false case.
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2427