How to manually set a cookie in JMeter that is set programmatically by JavaScript
<p>I am testing a web application which has a following flow : </p>

<ol>
<li>User logs in</li>
<li>On successful login, an access token is issued.</li>
<li>Every request after login has the access token to get a resource. </li>
</ol>

<p>In my JMeter test plan, I added a cookie manager and I could extract this access token from the response header of the login request. I want to set this access token as a cookie the test plan.  </p>

<p>I added this after extracting the access token in a BSF PostProcessor : <em>vars.put('COOKIE_access_token', actual_token);</em> and it is seen as a cookie variable in the debug sampler. </p>

<p><img src="https://i.stack.imgur.com/kau1V.jpg" alt="enter image description here"></p>

<p>But the subsequent requests after login do not have this access token in their cookie data, and as a result are again redirected to login page. </p>

<p>How can I set this token as a cookie which will be used for all further requests? </p>