title: Maintain HTTP session in a Jenkins pipeline
body: <p>I want to use <a href="http://alm-help.saas.hp.com/en/12.50/api_refs/REST/webframe.htm#Overview.htm" rel="nofollow noreferrer">ALM REST API</a> inside a Jenkins pipeline. To use this API I need to follow those steps : </p>
  
  <ol>
  <li>authentication + sign-in (session cookie created)</li>
  <li>get what I need</li>
  <li>sign-out</li>
  </ol>
  
  <p>I also need to <strong>maintain</strong> a session :</p>
  
  <blockquote>
    <p>Although RESTful applications are ideally stateless, the ALM platform requires sessions to manage locking, client lifetime, and perform other basic tasks. </p>
  </blockquote>
  
  <p>Using the <a href="https://wiki.jenkins.io/display/JENKINS/HTTP+Request+Plugin" rel="nofollow noreferrer">HTTP Request Plugin</a>, I'm not able to maintain the session.</p>
  
  <p>I have a working solution using curl and the pipeline step "sh" but I would like to do something cleaner, using a step from a plugin/jenkins or some groovy/java solution.</p>