Created attachment 21816 [details] Patch to fix the mismatching session id Hello, When trying to load-test an AJAX heavy web application I ran into the following error: At some point during my test plan my sessionid was replaced by the sessionid followed by a backslash. After a bit of digging I found out that this occurred when there was JavaScript of the following type in the page: sessionidvar = \'<sessionidvalue>\'; (for being used in an XMLHttpRequest) I just added the backslash to the "terminating" characters for a normal sessionid (as I don't believe that it would be part of a sessionid anyway), and it worked just fine. I include the patch to URLRewritingModified.java in here. Regards, Jens
I tried adding a test for this, but the test failed with your patch. What is the surrounding context for the assignment?
Some of the initial assumptions were wrong, I admit :) I thought that is was because of a session variable passed in along JavaScript, but after some debugging I found out that it was because of a complete URL passed along in JavaScript (probably for a redirect), quote in single quotes, which posed the problem. So if something like this in the response, the URLRewritingModifier might cause a problem: newurl = \'/index.html?sessionid=blabla\'; I have created a unittest for that (testGrabSessionIdURLinJSON), and updated my patch to include the unit test. Without my patch, the unit test fails, with the patch, it runs fine. I hope this will help you to resolve the issue. Regards, Jens
Created attachment 21823 [details] Updated patch for session id parsing, including unittest
Can you provide a full URL showing the problem? If necesary, change the host etc to anonymise the URL. No need for a new test case, I can adjust as necesssary.
I'm not entirely sure (the page is quite long, it is hard to read.....), but I think the following line is the "offender": <a href=\"#\" onclick=\"$(\'mailpreview_iframe\').src=\'/webmail/mail_download/?preview=1&fldr=INBOX&id=2&partid=1&mediatype=TEXT%2FPLAIN&encoding=7BIT&charset=us-ascii&textpreview=1&tempid=HUDXReOOE2y2QS2m\';\" title=\"Textnachricht anzeigen\"> Regards, Jens
I assume you are lookig for "tempid" here?
Yes, exactly. That is the session identifier. It is configured as that, without any extra options except "cached" set on in the URLRewritingModifier. Regards, Jens
OK, thanks for the patch. I've added it to SVN: http://svn.apache.org/viewvc?rev=648901&view=rev
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2097