var cookie_str_splitter=/[:](?=\s*[a-zA-Z0-9_\-]+\s*[=])/g function stringify (cookie) { var str=[cookie.name+"="+cookie.value]; if(cookie.expiration_date !== Infinity) { str.push("expires="+(new Date(cookie.expiration_date)).toGMTString()); } if(cookie.domain) { str.push("domain="+cookie.domain); } if(cookie.path) { str.push("path="+cookie.path); } if(cookie.secure) { str.push("secure"); } if(cookie.noscript) { str.push("httponly"); } return str.join("; "); } function Jar () { this.cookies = [] } Jar.prototype.setCookies = function (cookieString) { } Jar.prototype.getHeader = function (host, path) { } Jar.prototype.getCookies = function (access_info) { var matches=[]; for(var cookie_name in cookies) { var cookie=this.getCookie(cookie_name,access_info); if (cookie) { matches.push(cookie); } } matches.toString=function toString(){return matches.join(":");} return matches; } Jar.prototype.getCookie = function (host, path) { var cookies_list = self.cookies[cookie_name]; for(var i=0;i