]> khamidou — GitHub mirrors - electron.git/commitdiff
Make cookie aligns to Chrome's.
authorHaojian Wu <hokein.wu@gmail.com>
Fri, 19 Jun 2015 06:18:22 +0000 (14:18 +0800)
committerHaojian Wu <hokein.wu@gmail.com>
Fri, 19 Jun 2015 06:18:22 +0000 (14:18 +0800)
atom/browser/api/atom_api_cookies.cc
docs/api/browser-window.md

index 6f59cd25bbe1a326058503ea94c90bb8ecb60277..4a0060efa537450d87d59091af0e04069327987b 100644 (file)
@@ -161,8 +161,8 @@ struct Converter<net::CanonicalCookie> {
     mate::Dictionary dict(isolate, v8::Object::New(isolate));
     dict.Set("name", val.Name());
     dict.Set("value", val.Value());
-    dict.Set("source", val.Source());
     dict.Set("domain", val.Domain());
+    dict.Set("host_only", net::cookie_util::DomainIsHostOnly(val.Domain()));
     dict.Set("path", val.Path());
     dict.Set("secure", val.IsSecure());
     dict.Set("http_only", val.IsHttpOnly());
index 01298ce4dea43450b08bd01816d552ae5e6d02a4..2c41200da2bdad39d60b1cc5f47cc4799159e7d9 100644 (file)
@@ -1069,7 +1069,20 @@ win.webContents.on('did-finish-load', function() {
   * `session` Boolean - Filters out session or persistent cookies.
 * `callback` Function - function(error, cookies)
   * `error` Error
-  * `cookies` Array - array of cookie objects.
+  * `cookies` Array - array of `cookie` objects.
+    * `cookie` - Object
+      *  `name` String - The name of the cookie
+      *  `value` String - The value of the cookie
+      *  `domain` String - The domain of the cookie
+      *  `host_only` String - Whether the cookie is a host-only cookie
+      *  `path` String - The path of the cookie
+      *  `secure` Boolean - Whether the cookie is marked as Secure (typically HTTPS)
+      *  `http_only` Boolean - Whether the cookie is marked as HttpOnly
+      *  `session` Boolean - Whether the cookie is a session cookie or a persistent
+      *    cookie with an expiration date.
+      *  `expirationDate` Double - (Option) The expiration date of the cookie as
+           the number of seconds since the UNIX epoch. Not provided for session cookies.
+
 
 ### WebContents.session.cookies.set(details, callback)