title: JMeter - Share Session Between Thread Groups
body: <p>I'm fairly new to JMeter; I have been searching for a way to share a session id between HTTP Requests within concurrently executing Thread Groups. I checked over the other questions, but they don't seem to deal with sessions, and I already accomplished my goal of sharing CSV vars between threads.</p>
  
  <p>My Test Suite structure:</p>
  
  <pre><code>Test Plan
  - HTTP Cookie Manager
  - CSV Data Set (sharing mode: all threads)
  - HTTP URL Re-Writing Modifier (session arg name: jsessionid, caches session id)
  
  - Thread Group 1
  ---Controller
  ------HTTP Request (uses csv value)
  
  ...
  
  - Thread Group N (duplicates of TG 1)
  ---Controller
  ------HTTP Request (uses csv value)
  </code></pre>
  
  <p>This is the flow that my Test Plan takes (as seen by a View Results Tree Listener):</p>
  
  <pre><code>HTTP Request (TG 1-1) CSV Value: (1) *caches session id, let's say 123
  ...
  HTTP Request (TG N-1) CSV Value: (1) *caches different session id, let's say 456
  HTTP Request (TG 1-2) CSV Value: (2) jsessionid=123
  ...
  HTTP Request (TG N-2) CSV Value: (2) jsessionid=456
  </code></pre>
  
  <p>My goal is to send a number of identical requests with the same session id at once. As you can see, they are identical aside from the session id. What can I do to fix this?</p>