title: Cookies set, but not sent to Cloudfront
body: <p>I'm attempting to use <a href="http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-signed-cookies.html" rel="noreferrer">signed cookies</a> to access private content on AWS Cloudfront.</p>
  
  <ul>
  <li>Rails 4.2.1 app running in development on Puma server - <a href="http://localhost:3000" rel="noreferrer">http://localhost:3000</a></li>
  <li>Using latest Chrome (and can reproduce same in Firefox and Safari)</li>
  </ul>
  
  <p>My app successfully sets the correct cookies required by cloudfront, and each cookie has the correct value. For reference, the three cookies that need to be set are:</p>
  
  <ul>
  <li>CloudFront-Policy</li>
  <li>CloudFront-Signature</li>
  <li>CloudFront-Key-Pair-Id</li>
  </ul>
  
  <p>I know that the values are correct as if I grab those cookies and perform a curl request using them, it is successful (values replaced with ... for the sake of brevity):</p>
  
  <pre><code>curl -v -b "CloudFront-Signature=...; CloudFront-Policy==...; CloudFront-Key-Pair-Id==...;" http://mydistribution.cloudfront.net/myfile.jpg
  </code></pre>
  
  <h2>The fault</h2>
  
  <p>When I use the browser, whilst I can see the cookies have been set in my original request to the server <a href="http://localhost:3000/" rel="noreferrer">http://localhost:3000/</a>, my requests to Cloudfront urls (for example, in my image tags) do not pass on any of these cookies. This results in </p>
  
  <pre><code>&lt;Error&gt;&lt;Code&gt;MissingKey&lt;/Code&gt;&lt;Message&gt;Missing Key-Pair-Id query parameter or cookie value&lt;/Message&gt;&lt;/Error&gt;
  </code></pre>
  
  <p>Any ideas why my cookies are not being sent to cloudfront? Advice and support appreciated :)</p>