I'm doing load testing for an application using JMeter for which I need to perform SSO authentication. I have to send a cookie as request header like I it is done below:
I have the value that I need to send, which I have extracted using Regular Expression Extractor on a previous Request. How can I achieve this?
I am using JMeter 3.1
Add JSR223 Sampler and use this code
import org.apache.jmeter.protocol.http.control.CookieManager;
import org.apache.jmeter.protocol.http.control.Cookie;
CookieManager manager = sampler.getCookieManager();
Cookie cookie = new Cookie("SESSION_COOKIE_NAME", "${my_cookie}", "${servername}", "/", false, 0);
manager.add(cookie);
More info for CookieManager class here