title: How to get cookie information using excel vba
body: <p>I am trying to get cookie information from under Network --&gt; RequestHeader of below page <a href="https://www.nseindia.com/market-data/equity-derivatives-watch" rel="nofollow noreferrer">https://www.nseindia.com/market-data/equity-derivatives-watch</a>
  All I am getting from the below code is Response headers &quot;set-cookie&quot;, but I need &quot;cookie&quot; information under request headers. Below is the code I've tried.</p>
  <pre><code>Function GetCookie(strUrl)
      With CreateObject(&quot;WinHttp.WinHttpRequest.5.1&quot;)
          .Open &quot;GET&quot;, strUrl, False
          .SetRequestHeader &quot;REFERER&quot;, strUrl
          .SetRequestHeader &quot;User-Agent&quot;, &quot;Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)&quot;
          .SetRequestHeader &quot;Accept&quot;, &quot;text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5&quot;
          .SetRequestHeader &quot;Accept-Language&quot;, &quot;en-us,en;q=0.5&quot;
          .SetRequestHeader &quot;Accept-Charset&quot;, &quot;ISO-8859-1,utf-8;q=0.7,*;q=0.7&quot;
          .Send
          strCookie = .GetAllResponseHeaders
  
          strCookie = Split(strCookie, vbCrLf)
  
          Debug.Print strCookie
  
  '        strCookie = Split(strCookie, &quot;;&quot;)(0)
  '        GetCookie = strCookie
      End With
  End Function
  
  
  
  Sub Demo()
  Debug.Print GetCookie(&quot;https://www.nseindia.com/market-data/equity-derivatives-watch&quot;)
  End Sub
  </code></pre>
  <p>I need the below cookie information</p>
  <p><a href="https://i.stack.imgur.com/ygxol.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ygxol.png" alt="enter image description here" /></a></p>