Make cookie aligns to Chrome's.

This commit is contained in:
Haojian Wu 2015-06-19 14:18:22 +08:00
parent 969916442f
commit c164da5a38
2 changed files with 15 additions and 2 deletions

View 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());

View 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)