<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -128,6 +128,7 @@ void curl_easy_mark(ruby_curl_easy *rbce) {
   rb_gc_mark(rbce-&gt;userpwd);
   rb_gc_mark(rbce-&gt;proxypwd);  
   rb_gc_mark(rbce-&gt;headers);
+  rb_gc_mark(rbce-&gt;cookies);
   rb_gc_mark(rbce-&gt;cookiefile);
   rb_gc_mark(rbce-&gt;cookiejar);
   rb_gc_mark(rbce-&gt;cert);
@@ -191,6 +192,7 @@ static VALUE ruby_curl_easy_new(int argc, VALUE *argv, VALUE klass) {
   rbce-&gt;userpwd = Qnil;
   rbce-&gt;proxypwd = Qnil;
   rbce-&gt;headers = rb_hash_new();
+  rbce-&gt;cookies = Qnil;
   rbce-&gt;cookiefile = Qnil;
   rbce-&gt;cookiejar = Qnil;
   rbce-&gt;cert = Qnil;
@@ -437,6 +439,29 @@ static VALUE ruby_curl_easy_proxypwd_get(VALUE self) {
   CURB_OBJECT_GETTER(ruby_curl_easy, proxypwd);
 }
 
+
+/*
+ * call-seq:
+ *   easy.cookies = &quot;name1=content1; name2=content2;&quot;                =&gt; &quot;pwd string&quot;
+ *
+ * Set cookies to be sent by this Curl::Easy instance. The format of the string should
+ * be NAME=CONTENTS, where NAME is the cookie name and CONTENTS is what the cookie should contain. 
+ * Set multiple cookies in one string like this: &quot;name1=content1; name2=content2;&quot; etc. 
+ */
+static VALUE ruby_curl_easy_cookies_set(VALUE self, VALUE cookies) {
+  CURB_OBJECT_SETTER(ruby_curl_easy, cookies);
+}
+
+/*
+ * call-seq:
+ *   easy.cookies                                   =&gt; &quot;name1=content1; name2=content2;&quot;
+ * 
+ * Obtain the cookies for this Curl::Easy instance. 
+ */ 
+static VALUE ruby_curl_easy_cookies_get(VALUE self) {
+  CURB_OBJECT_GETTER(ruby_curl_easy, cookies);
+}
+
 /*
  * call-seq:
  *   easy.cookiefile = &quot;cookies.txt&quot;                =&gt; &quot;pwd string&quot;
@@ -452,7 +477,7 @@ static VALUE ruby_curl_easy_cookiefile_set(VALUE self, VALUE cookiefile) {
 
 /*
  * call-seq:
- *   easy.cookiefile                                   =&gt; &quot;cookies.txt&quot;&quot;
+ *   easy.cookiefile                                   =&gt; &quot;cookies.txt&quot;
  * 
  * Obtain the cookiefile file for this Curl::Easy instance. 
  */ 
@@ -1414,6 +1439,10 @@ VALUE ruby_curl_easy_setup( ruby_curl_easy *rbce, VALUE *body_buffer, VALUE *hea
     }
   }
 
+  if (rbce-&gt;cookies != Qnil) {
+    curl_easy_setopt(curl, CURLOPT_COOKIE, StringValuePtr(rbce-&gt;cookies));
+  }
+
   /* Set up HTTPS cert handling if necessary */
   if (rbce-&gt;cert != Qnil) {
     curl_easy_setopt(curl, CURLOPT_SSLCERT, StringValuePtr(rbce-&gt;cert));
@@ -2585,6 +2614,8 @@ void init_curb_easy() {
   rb_define_method(cCurlEasy, &quot;userpwd&quot;, ruby_curl_easy_userpwd_get, 0);
   rb_define_method(cCurlEasy, &quot;proxypwd=&quot;, ruby_curl_easy_proxypwd_set, 1);
   rb_define_method(cCurlEasy, &quot;proxypwd&quot;, ruby_curl_easy_proxypwd_get, 0);
+  rb_define_method(cCurlEasy, &quot;cookies=&quot;, ruby_curl_easy_cookies_set, 1);
+  rb_define_method(cCurlEasy, &quot;cookies&quot;, ruby_curl_easy_cookies_get, 0);
   rb_define_method(cCurlEasy, &quot;cookiefile=&quot;, ruby_curl_easy_cookiefile_set, 1);
   rb_define_method(cCurlEasy, &quot;cookiefile&quot;, ruby_curl_easy_cookiefile_get, 0);
   rb_define_method(cCurlEasy, &quot;cookiejar=&quot;, ruby_curl_easy_cookiejar_set, 1);</diff>
      <filename>ext/curb_easy.c</filename>
    </modified>
    <modified>
      <diff>@@ -32,6 +32,7 @@ typedef struct {
   VALUE userpwd;
   VALUE proxypwd;
   VALUE headers;        /* ruby array of strings with headers to set */
+  VALUE cookies;        /* string */
   VALUE cookiefile;     /* filename */
   VALUE cookiejar;      /* filename */
   VALUE cert;</diff>
      <filename>ext/curb_easy.h</filename>
    </modified>
    <modified>
      <diff>@@ -433,6 +433,13 @@ class TestCurbCurlEasy &lt; Test::Unit::TestCase
     assert c.enable_cookies?
   end
 
+  def test_cookies_option
+    c = Curl::Easy.new
+    assert_nil c.cookies
+    assert_equal &quot;name1=content1; name2=content2;&quot;, c.cookies = &quot;name1=content1; name2=content2;&quot;
+    assert_equal &quot;name1=content1; name2=content2;&quot;, c.cookies
+  end
+
   def test_cookiefile
     c = Curl::Easy.new
     assert_nil c.cookiefile</diff>
      <filename>tests/tc_curl_easy.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a4910c25198441796f8e6d1958e144998833c7ec</id>
    </parent>
  </parents>
  <author>
    <name>Cheah Chu Yeow</name>
    <login>chuyeow</login>
    <email>chuyeow@gmail.com</email>
  </author>
  <url>http://github.com/taf2/curb/commit/3c3e53c64a2417f78aa19f593a5f66e3ddffc969</url>
  <id>3c3e53c64a2417f78aa19f593a5f66e3ddffc969</id>
  <committed-date>2009-06-13T08:28:32-07:00</committed-date>
  <authored-date>2009-06-08T04:50:09-07:00</authored-date>
  <message>Add a cookies option that mirrors the CURLOPT_COOKIE option in libcurl. This allows you to pass a simple cookie string like so: &quot;name1=content1; name2=content2;&quot;.

Signed-off-by: Todd Fisher &lt;todd.fisher@gmail.com&gt;</message>
  <tree>83ef883a51153784fb97e28c584a6a548e4029c7</tree>
  <committer>
    <name>Todd Fisher</name>
    <login>taf2</login>
    <email>todd.fisher@gmail.com</email>
  </committer>
</commit>
