title: Copying cookie for httr
body: <p>I'm trying to access a site that sets a cookie on the basis of what type of visitor: </p>
  
  <pre><code>library(httr)
  url &lt;- "https://www.blackrock.com/ca/individual/en/products/product-list#categoryId=1&amp;lvl2=overview"
  </code></pre>
  
  <p>Essentially everything I've tried returns the this...: </p>
  
  <p><code>GET(url)</code></p>
  
  <pre><code>Response [https://www.blackrock.com/ca/individual/en/site-entry?targetUrl=%2Fca%2Findividual%2Fen%2Fproducts%2Fproduct-list%3FsiteEntryPassthrough%3Dtrue]
    Status: 200
    Content-type: text/html;charset=UTF-8
    Size: 270 kB
  &lt;!DOCTYPE html&gt;&lt;html xmlns="http://www.w3.org/1999/xhtml" prefix="og: http://ogp.me/ns#" lang="en" xml:lang="en"&gt;&lt;head&gt;&lt;meta content="text/html;charset=UTF-8" http-equiv="Content-type...
  &lt;meta name="description" content="" /&gt;
  &lt;meta name="robots" content="noindex,noarchive,nocache" /&gt;
  &lt;meta property="og:title" content="Site Entry" /&gt;
  &lt;meta property="og:type" content="website" /&gt;
  &lt;meta property="og:image" content="/amer-retail-assets/include/common/images/blackrock_logo.png" /&gt;
  &lt;meta property="og:site_name" content="BlackRock" /&gt;
  &lt;meta property="og:locale" content="en_CA" /&gt;
  &lt;meta property="og:url" content="https://www.blackrock.com/ca/individual/en/site-entry?locale=en_CA" /&gt;
  &lt;link rel="canonical" href="https://www.blackrock.com/ca/individual/en/site-entry?locale=en_CA" /&gt;
  </code></pre>
  
  <p>So, instead I tried copying the cookie after manually passing the gateway or site-entry page in chrome: </p>
  
  <pre><code>cookie = c(`JSESSION_amer-retail01` = "AC91C17F269D8F6A136E576531FA6E05",
  `UnicaID` = "10.39.18.249-1408392737241856",
  `UnicaNIODID` = "NQHKNKQYKDm-YxUEYgX",
  `_ga` = "GA1.2.127078965.1408392737",
  `blkUserType-ca-one` = "institutional",
  `s_pers` = "%20s_fid%3D14569E53C0F4EE51-3982590542B2DDA4%7C1471566685393%3B%20gpv%3Dca-one%257Cproducts%257Cproduct%2520list%7C1408410085400%3B%20s_nr%3D1408408285405-Repeat%7C1439944285405%3B%20s_pers_eVar15%3Dprospect%7C1411000285408%3B%20s_pers_prop19%3Danonymous%7C1411000285411%3B",
  `s_sess` = "%20s_cc%3Dtrue%3B%20s_sq%3D%3B", 
  `s_vi` = "[CS]v1|29F92F108507B6C6-6000010A8000E2ED[CE]",
  `ts-ca-one-locale` = "en_CA")
  </code></pre>
  
  <p><code>GET(url, set_cookies(.cookies = cookie), user_agent("Mozilla/5.0"))</code></p>
  
  <p>This returns the same result. </p>
  
  <p>However, when I look at the examples for <code>httr</code> I think the results I'm getting for setting the cookie are incorrect. </p>
  
  <p>For example: </p>
  
  <p><code>&gt; example(set_cookies)</code></p>
  
  <pre><code>st_cks&gt; set_cookies(a = 1, b = 2)
  Config: 
  List of 1
   $ cookie:"a1=;b2="
  
  st_cks&gt; set_cookies(.cookies = c(a = "1", b = "2"))
  Config: 
  List of 1
   $ cookie:"a1=;b2="
  
  st_cks&gt; GET("http://httpbin.org/cookies")
  Response [http://httpbin.org/cookies]
    Status: 200
    Content-type: application/json
    Size: 19 B
  {
    "cookies": {}
  
  st_cks&gt; GET("http://httpbin.org/cookies", set_cookies(a = 1, b = 2))
  Response [http://httpbin.org/cookies]
    Status: 200
    Content-type: application/json
    Size: 50 B
  {
    "cookies": {
      "a1": "", 
      "b2": ""
    }
  </code></pre>
  
  <p>I would have expected httpbin.org to return a = 1 and b = 1 instead of a1 = and b2 =. Am I doing something wrong?</p>