JMeter 5.4 上的互换 Cookie

Interchanged Cookie on JMeter 5.4

由于 log4j 问题,我将我的 JMeter 从 3.0 升级到 5.4.3,但是我现在遇到了 cookie 处理问题:

JMeter 3.0

JMeter 5.4

正如您在结果中看到的,grid-sid-axxx 被移到 JSESSIONID=z-dxxx 之后,这导致我这边出现 session 错误。我怎样才能交换这些 cookie 值,这样我就可以避免由于交换 cookie 值而导致的 session 问题。

HTTP Cookie 管理器、HTTP Header 管理器和 HTTP 请求采样器没有变化

谢谢,

根据 specification:

Although cookies are serialized linearly in the Cookie header, servers SHOULD NOT rely upon the serialization order. In particular, if the Cookie header contains two cookies with the same name (e.g., that were set with different Path or Domain attributes), servers SHOULD NOT rely upon the order in which these cookies appear in the header.

所以我的期望是在 Cookie header 中发送的 cookie 的顺序并不重要,如果两个 cookie 都存在,请求应该会成功。

因此可能值得联系您的应用程序开发人员,以便最终解决问题。

此外,始终可以使用 Regular Expression Extractor and add the HTTP Header Manager configured to send the Cookie header 从响应中提取 cookie,其中的值按您想要的顺序排列。