Using cookies with REST::Client
<p>I'm trying to get REST::Client to use cookies in its requests. SO, I set it up like this:</p>

<pre><code>my $cookie_jar = HTTP::Cookies-&gt;new( file =&gt; "lwp_cookies.dat", autosave =&gt; 1 );
my $ua = LWP::UserAgent-&gt;new( cookie_jar =&gt; $cookie_jar );
my $client = REST::Client-&gt;new({ useragent =&gt; $ua, host =&gt; $BASE_API_URL });
</code></pre>

<p>But when I do my <code>$client-&gt;GET()</code> and <code>$client-&gt;PUT</code> calls, there are no cookies headers passed around, and no cookies file is created on disk. I also tried add  <code>keep_alive =&gt; 1</code> option for LWP::UserAgent->new(), but my Connection headers are still <code>Connection: TE, close</code>.</p>

<p>I'm checking the requests with Fiddler/"raw" tab. What am I missing?</p>