title: setting cookie for use in warden. "invalid cookie value"
body: <p>I am writing specs for my api and am manually writing a http request.</p>
  
  <p>I am trying to set a cookie by adding the following key-val header</p>
  
  <p>cookies</p>
  
  <pre><code>cookies: {
          'warden.user.user.key' =&gt; ActiveSupport::JSON.encode(
            [[session_data[0]], session_data[1]]
          )
        }
  </code></pre>
  
  <p>That's a String-String key-val pair, but the value is invalid. I get <code>ArgumentError: Invalid cookie value</code> for the JSON-serialized value (which ends up as</p>
  
  <pre><code>"\"[[Xy2LppWrQ53yHmpxVOkF7w], $2a$10$a/kS05VaSlNv2wwBXPfGU.]\""
  </code></pre>
  
  <p>I honestly have no idea how to fix this. I am trying to make a cookie with this format because in my Controller, I figured out that the session cookie is stored in <code>warden.user.user.key</code> and the value is a nested array of <code>[[object_uid], session_token]</code></p>
  
  <p>Appreciate whatever help! thanks</p>
  
  <p>If it makes any difference, I am using <a href="https://github.com/brooklynDev/airborne" rel="nofollow">airborne</a> to make the requests (which uses rest-client under the hood, but doesn't throw errors on non-OK status codes.)</p>
  
  <p>In the bigger picture I'm just trying to pass a session token to warden, which is used by devise. </p>