title: Updating JSESSIONID cookie value
body: <p>I am trying to update the <code>JSESSIONID</code> value as below but its creating a new <code>JSESSIONID</code> cookie for each request. </p>
  
  <pre><code>    Cookie[] cookies = httpRequest.getCookies();
      Cookie jsessionCookie = null;
      Cookie hazelcastCookie = null;
      if (cookies != null) for (Cookie cookie : cookies) {
          if (cookie.getName().equals(JSESSION_COOKIE_NAME))
              jsessionCookie = cookie;
          else if (cookie.getName().equals(HAZELCAST_COOKIE_NAME)) hazelcastCookie = cookie;
      }
      if (jsessionCookie != null &amp;&amp; hazelcastCookie != null
              &amp;&amp; jsessionCookie.getValue() != hazelcastCookie.getValue()) {
          jsessionCookie.setValue(hazelcastCookie.getValue());
          httpResponse.addCookie(jsessionCookie);
          LOGGER.log(Level.DEBUG,
                  "Updated jsessionCookie value with  hazelcastCookie --&gt; " + jsessionCookie.getValue());
      }
  </code></pre>
  
  <p>What change I should make to just update the <code>JSESSIONID</code> value instead of creating a new one for each request?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p><strong>Request Headers</strong></p>
  
  <pre><code>Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
  Accept-Encoding:gzip, deflate, sdch
  Accept-Language:en-US,en;q=0.8
  Connection:keep-alive
  Cookie:WebDAV.activeX=false; JSESSIONID=HZ9542C5A55A7142A28935DFF96746230F; hazelcast.sessionId=HZ9542C5A55A7142A28935DFF96746230F; JSESSIONID=HZ9542C5A55A7142A28935DFF96746230F; sessionIdForCognos=HZ9542C5A55A7142A28935DFF96746230F; _sd3_session_id=5436c0eebe806f38ca8d1e2867338e00
  </code></pre>
  
  <p><strong>Response Headers</strong></p>
  
  <pre><code>Cache-Control:no-cache
  Connection:Keep-Alive
  Content-Encoding:gzip
  Content-Language:en-US
  Content-Length:6538
  Content-Type:text/html;charset=utf-8
  Date:Thu, 14 Apr 2016 22:20:36 GMT
  Expires:Wed, 31 Dec 1969 23:59:59 GMT
  Keep-Alive:timeout=70, max=57
  Pragma:no-cache
  Server:None
  Set-Cookie:JSESSIONID=508E10266957BFF95874CEBFECF5FBAF.qa-trunk-n2; Path=/Passport; Secure; HttpOnly
  Set-Cookie:hazelcast.sessionId=HZ9542C5A55A7142A28935DFF96746230F; Path=/Passport
  Set-Cookie:JSESSIONID=HZ9542C5A55A7142A28935DFF96746230F
  </code></pre>