jmeter grabs the Set-Cookie value using regular expressions from the previous request and uses it in the next request

The problem encountered at work, the login request, there is a parameter Set-Cookie in the returned Response Headers, which needs to be captured and applied to the next request, as shown in the following figure:

jmeter grabs the Set-Cookie value using regular expressions from the previous request and uses it in the next request

Grab the value of Set-Cookie by regular expression. Since this value exists in Response Headers, the regular expression needs to be selected as "information header":

jmeter grabs the Set-Cookie value using regular expressions from the previous request and uses it in the next request

To use in other requests, you need to add a "HTTP header manager", refer to the value captured above, see the figure below:

jmeter grabs the Set-Cookie value using regular expressions from the previous request and uses it in the next request

Send the request again, there is also a Set-Cookie value in the Response Headers, and the login timeout will not be returned.

jmeter grabs the Set-Cookie value using regular expressions from the previous request and uses it in the next request

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326217802&siteId=291194637