Reputation: 11
i can not get httpcontext session value through jmeter, how could i get session values from controller session through jmeter. can any one help!
variable: sessionid
regular expression: Set-Cookie:(,+?);
template: $1$
Upvotes: 1
Views: 578
Reputation: 168157
If you need to do this using Regular Expression Extractor:
Response Headers
as the "Field to Check"Amend your regular expression to look like:
Set-Cookie: (.*)
However this approach will give you full contents of the Set-Cookie header, not only the value but also domain, path, expires, secure, httponly attributes.
If you want to get the value of a single cookie into a JMeter Variable the easiest way is:
Add the next line to user.properties file:
CookieManager.save.cookies=true
That's it, now you can access any cookie value using the following pattern:
${COOKIE__your cookie name here}
so if you have cookie named sessionid
you can read its value as ${COOKIE__sessionid}
More information: HTTP Cookie Manager Advanced Usage - A Guide
Upvotes: 1