<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>article Sample Post Execution script JavaScript Code to retrieve the 'Set-Cookie' header on Synthetic HTTP monitors. in Troubleshooting</title>
    <link>https://community.dynatrace.com/t5/Troubleshooting/Sample-Post-Execution-script-JavaScript-Code-to-retrieve-the-Set/ta-p/209465</link>
    <description>&lt;P&gt;You can use the below Sample Post Execution script JavaScript Code to retrieve the 'Set-Cookie' header on Synthetic HTTP monitors.&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;var cookies = response.getHeaders().getAll('Set-Cookie');
var setcookie2 = cookies.get(1); //index-1
api.setValue("Set-Cookie", setcookie2);
var cookieslength = cookies.size();
api.info("cookies length " + cookieslength);
for(i=0;i&amp;lt;cookieslength;i++)
{
cookie = cookies.get(i);
api.info( i + ". cookie: " + cookie);
}&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 11 Apr 2023 14:17:43 GMT</pubDate>
    <dc:creator>Mareeswaran</dc:creator>
    <dc:date>2023-04-11T14:17:43Z</dc:date>
    <item>
      <title>Sample Post Execution script JavaScript Code to retrieve the 'Set-Cookie' header on Synthetic HTTP monitors.</title>
      <link>https://community.dynatrace.com/t5/Troubleshooting/Sample-Post-Execution-script-JavaScript-Code-to-retrieve-the-Set/ta-p/209465</link>
      <description>&lt;P&gt;You can use the below Sample Post Execution script JavaScript Code to retrieve the 'Set-Cookie' header on Synthetic HTTP monitors.&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;var cookies = response.getHeaders().getAll('Set-Cookie');
var setcookie2 = cookies.get(1); //index-1
api.setValue("Set-Cookie", setcookie2);
var cookieslength = cookies.size();
api.info("cookies length " + cookieslength);
for(i=0;i&amp;lt;cookieslength;i++)
{
cookie = cookies.get(i);
api.info( i + ". cookie: " + cookie);
}&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 11 Apr 2023 14:17:43 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Troubleshooting/Sample-Post-Execution-script-JavaScript-Code-to-retrieve-the-Set/ta-p/209465</guid>
      <dc:creator>Mareeswaran</dc:creator>
      <dc:date>2023-04-11T14:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: Sample Post Execution script JavaScript Code to retrieve the 'Set-Cookie' header on Synthetic HTTP monitors.</title>
      <link>https://community.dynatrace.com/t5/Troubleshooting/Sample-Post-Execution-script-JavaScript-Code-to-retrieve-the-Set/tac-p/212117#M206</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.dynatrace.com/t5/user/viewprofilepage/user-id/40562"&gt;@Mareeswaran&lt;/a&gt;&amp;nbsp;for sharing this!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2023 19:18:33 GMT</pubDate>
      <guid>https://community.dynatrace.com/t5/Troubleshooting/Sample-Post-Execution-script-JavaScript-Code-to-retrieve-the-Set/tac-p/212117#M206</guid>
      <dc:creator>ChadTurner</dc:creator>
      <dc:date>2023-05-12T19:18:33Z</dc:date>
    </item>
  </channel>
</rss>

