--- /home/arecascino/netsurf/content/handlers/javascript/duktape/Document.bnd	2017-01-28 20:48:26.692910841 -0500
+++ Document.bnd	2017-01-28 20:34:03.511604936 -0500
@@ -317,6 +317,29 @@
 	return 0;
 %}
 
+setter Document::cookie()
+%{
+    /* DISCLAIMER: ONLY WORKS ON REMOTE URLS */
+    const char *cookie_str;
+    struct html_content *htmlc;
+    dom_exception err;   
+    err = dom_node_get_user_data(priv->parent.node,
+                     corestring_dom___ns_key_html_content_data,
+                     &htmlc);
+    if((err == DOM_NO_ERR) && (htmlc != NULL)) {
+        cookie_str = duk_get_string(ctx,0);
+        if(cookie_str != NULL) {
+            urldb_set_cookie(cookie_str,
+                     llcache_handle_get_url(htmlc->base.llcache),
+                     0);
+            return 1;
+        }    
+    } else {
+        LOG("error getting htmlc. parent node:%p htmlc:%p",
+            priv->parent.node, htmlc);
+    }
+    return 0;
+%}
 getter Document::onabort();
 setter Document::onabort();
 getter Document::onautocompleteerror();
