title: Set cookie in Postman with variable
body: <p>I'm trying to write some postman tests that require me to set a cookie.  My first request returns a token in a json payload. I've pulled this out and stored it in a variable but I cant seem to inject this into a cookie for further requests.</p>
  
  <p>I get the value for the cookie like:</p>
  
  <pre><code>var json = pm.response.json();
  pm.globals.set("my-cookie", json.Token);
  </code></pre>
  
  <p>I've tried this in the cookie dialog box:</p>
  
  <pre><code>my-cookie={{my-cookie}}; path=/; domain=.myhost.com; Expires=Tue, 19 Jan 2038 03:14:07 GMT;
  </code></pre>
  
  <p>However when it sends the cookie it sends the above without replacing the variable the, i.e. it has {{my-cookie}} rather than the value of the variable.</p>
  
  <p>I cant see anything in the postman API that will enable me to set cookies on a request grammatically.  </p>
  
  <p>I did see this, but it only mentions adding them via the dialog</p>
  
  <p><a href="https://www.getpostman.com/docs/v6/postman/sending_api_requests/interceptor_extension" rel="noreferrer">https://www.getpostman.com/docs/v6/postman/sending_api_requests/interceptor_extension</a></p>
  
  <p>I also found this, but could find no mention of how to use it.</p>
  
  <p><a href="https://www.postmanlabs.com/postman-collection/Cookie.html" rel="noreferrer">https://www.postmanlabs.com/postman-collection/Cookie.html</a></p>
  
  <p>I'm assuming this is a common requirement and must be missing something obvious. Does anyone know how to do this?</p>