Q:

how to dynamic set cookie value in jmeter

Jmeter test plan structure
Test Plan
Test Thread

    Cookie Manager(set variable PHPSessionID)

    HTTP request A

    regular expression extractor(get value from HTTP A's response, set PHPSessionID value)

    HTTP request B(I want PHPSessionID send by B request as a cookie value )

As we know Config controller is execute before A request, so it won't reset PHPSessionID value in Cookie. Is there any method to do what I want? Any help is appreciated

A:

Cookie information is dynamic for each thread, so I think it already does what you want:

If you have an HTTP Request and the response contains a cookie, the
  Cookie Manager automatically stores that cookie and will use it for
  all future requests to that particular web site. Each JMeter thread
  has its own "cookie storage area". So, if you are testing a web site
  that uses a cookie for storing session information, each JMeter thread
  will have its own session. Note that such cookies do not appear on the
  Cookie Manager display, but they can be seen using the View Results
  Tree Listener.

http://jmeter.apache.org/usermanual/component_reference.html#HTTP_Cookie_Manager

