In K6, I am setting cookieJar
as below
const jar = http.cookieJar();
jar.set('https://auth.mygateid.test', 'oktaStateToken', oktaStateToken);
Is there a way to do this in JMeter ? Is it really required in Jmeter?
Normally in JMeter it's sufficient just to add a HTTP Cookie Manager to your Test Plan and it will automatically take care of all incoming cookies, i.e. extract values from the Set-Cookie header of the response and add them to Cookie header of the request if the cookie is valid (domain/path match, not expired, etc.)
It is also possible to manually add cookie if you need:
More information: Using the HTTP Cookie Manager in JMeter