title: jmeter - second post request is not using the JSESSIONID created on my log in post request
body: <p>I was successfully able to send a POST request for my log in end point and a JSESSIONID was created.  I know the JSESSIONID is kept by the HTTP Cookie Manager that I have at the top of my thread because I see it being used on several GET requests I have in my thread.</p>
  
  <p>But when I attempt a POST request it does not use the JSESSIONID and creates its own ID. Below are my settings:</p>
  
  <p>Protocol: https
  Method: POST
  -Use KeppAlive
  {"json":"params"}</p>
  
  <p><strong>Sampler Result:</strong>
  Thread Name: sim test 1-1
  Sample Start: 2014-02-18 15:42:42 EST
  Load time: 95
  Latency: 95
  Size in bytes: 239
  Headers size in bytes: 239
  Body size in bytes: 0
  Sample Count: 1
  Error Count: 0
  Response code: 302
  Response message: Found</p>
  
  <p>Response headers:
  HTTP/1.1 302 Found
  Server: Apache-Coyote/1.1
  Set-Cookie: JSESSIONID=F16BF82FD28A84F6E28DDE30DECDC48C; Path=/; Secure; HttpOnly
  Location: https : //api.zzzz com/site/needsAuth
  Content-Length: 0
  Date: Tue, 18 Feb 2014 20:42:42 GMT</p>
  
  <p>HTTPSampleResult fields:
  ContentType: 
  DataEncoding: null</p>
  
  <p><strong>Request:</strong>
  POST https : //api.zzz com/rest/members/347/passengers</p>
  
  <p>POST data:
  {"relationshipToMember":null,"authorizedToBook":false,"authorizedToFly":true,"authorizedToGetInfo":false,"passenger":{"firstName":"Mighty","middleName":null,"lastName":"Max","dateOfBirth": 1380857200000}}</p>
  
  <p>[no cookies]</p>
  
  <p>Request Headers:
  Connection: keep-alive
  Content-Type: application/json
  Content-Length: 204
  Host: api.zzz.com
  User-Agent: Apache-HttpClient/4.2.6 (java 1.5)</p>
  
  <p>-Note: I don't know if I am doing my GET requests correctly but they are working. They have Follow Redirects on and it first goes to http : //api.zzz... - 302 Found, then goes https : //api.zzz...</p>
  
  <p>edit:
  I found this which is exactly my problem: <a href="https://stackoverflow.com/questions/12966576/cookie-manager-of-apache-jmeter-doesnt-add-the-cookie-to-post-request">Cookie Manager of Apache JMeter doesn&#39;t add the cookie to POST request</a>, but I do not understand his solution if anyone can elaborate on the steps.</p>
  
  <p><strong>UPDATE</strong>
  Solved: I had to keep the same Server Name as my Log in POST and change my Path</p>