title: How to use cURL to send Cookies?
body: <p>I read that <a href="https://stackoverflow.com/questions/7181785/send-cookies-with-curl">sending cookies with cURL</a> works, but not for me.</p>
  <p>I have a REST endpoint like this:</p>
  <pre><code>class LoginResource(restful.Resource):
      def get(self):
          print(session)
          if 'USER_TOKEN' in session:
              return 'OK'
          return 'not authorized', 401
  </code></pre>
  <p>When I try to access the endpoint, it refuses:</p>
  <pre><code>curl -v -b ~/Downloads/cookies.txt -c ~/Downloads/cookies.txt http://127.0.0.1:5000/
  * About to connect() to 127.0.0.1 port 5000 (#0)
  *   Trying 127.0.0.1...
  * connected
  * Connected to 127.0.0.1 (127.0.0.1) port 5000 (#0)
  &gt; GET / HTTP/1.1
  &gt; User-Agent: curl/7.27.0
  &gt; Host: 127.0.0.1:5000
  &gt; Accept: */*
  &gt;
  * HTTP 1.0, assume close after body
  &lt; HTTP/1.0 401 UNAUTHORIZED
  &lt; Content-Type: application/json
  &lt; Content-Length: 16
  &lt; Server: Werkzeug/0.8.3 Python/2.7.2
  &lt; Date: Sun, 14 Apr 2013 04:45:45 GMT
  &lt;
  * Closing connection #0
  &quot;not authorized&quot;%
  </code></pre>
  <p>Where my <code>~/Downloads/cookies.txt</code> is:</p>
  <pre><code>cat ~/Downloads/cookies.txt
  USER_TOKEN=in
  </code></pre>
  <p>and the server receives nothing:</p>
  <pre><code>127.0.0.1 - - [13/Apr/2013 21:43:52] &quot;GET / HTTP/1.1&quot; 401 -
  127.0.0.1 - - [13/Apr/2013 21:45:30] &quot;GET / HTTP/1.1&quot; 401 -
  &lt;SecureCookieSession {}&gt;
  &lt;SecureCookieSession {}&gt;
  127.0.0.1 - - [13/Apr/2013 21:45:45] &quot;GET / HTTP/1.1&quot; 401 -
  </code></pre>
  <p>What is it that I am missing?</p>