{"action":"created","issue":{"url":"https://api.github.com/repos/SalesforceEng/tough-cookie/issues/42","labels_url":"https://api.github.com/repos/SalesforceEng/tough-cookie/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/SalesforceEng/tough-cookie/issues/42/comments","events_url":"https://api.github.com/repos/SalesforceEng/tough-cookie/issues/42/events","html_url":"https://github.com/SalesforceEng/tough-cookie/pull/42","id":80672543,"number":42,"title":"Serializable","user":{"login":"stash-sfdc","id":8163311,"avatar_url":"https://avatars.githubusercontent.com/u/8163311?v=3","gravatar_id":"","url":"https://api.github.com/users/stash-sfdc","html_url":"https://github.com/stash-sfdc","followers_url":"https://api.github.com/users/stash-sfdc/followers","following_url":"https://api.github.com/users/stash-sfdc/following{/other_user}","gists_url":"https://api.github.com/users/stash-sfdc/gists{/gist_id}","starred_url":"https://api.github.com/users/stash-sfdc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stash-sfdc/subscriptions","organizations_url":"https://api.github.com/users/stash-sfdc/orgs","repos_url":"https://api.github.com/users/stash-sfdc/repos","events_url":"https://api.github.com/users/stash-sfdc/events{/privacy}","received_events_url":"https://api.github.com/users/stash-sfdc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-05-25T21:23:46Z","updated_at":"2015-05-27T06:07:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/SalesforceEng/tough-cookie/pulls/42","html_url":"https://github.com/SalesforceEng/tough-cookie/pull/42","diff_url":"https://github.com/SalesforceEng/tough-cookie/pull/42.diff","patch_url":"https://github.com/SalesforceEng/tough-cookie/pull/42.patch"},"body":"WIP until documentation is done. The branch name is misleading; I intend for this to be for all store types, not just `MemoryCookieStore` (which is what I started out with).\r\n\r\n---\r\n\r\nAdd a `getAllCookies` interface to `CookieStore` so that stores can export all cookies.  In the case of stores where this is intractable or undesirable, they can elect to not implement `getAllCookies`.\r\n\r\nThe serialized format is vaguely:\r\n\r\n```js\r\n  var serialized = {\r\n    // The version of tough-cookie that serialized this jar. Generally a good\r\n    // practice since future versions can make data import decisions based on\r\n    // known past behavior. When/if this matters, use `semver`.\r\n    version: 'tough-cookie@'+VERSION,\r\n\r\n    // add the store type, to make humans happy:\r\n    storeType: type,\r\n\r\n    // CookieJar configuration:\r\n    rejectPublicSuffixes: !!this.rejectPublicSuffixes,\r\n\r\n    // this gets filled from getAllCookies after calling `toJSON` on them:\r\n    cookies: []\r\n  };\r\n```\r\n\r\nImporting the cookies repeatedly calls `store.putCookie()`, so this should work for all `CookieStore` implementations, in theory.  `Cookie.fromJSON` is called on each item in the `cookies` Array before being passed to `.putCookie()`."},"comment":{"url":"https://api.github.com/repos/SalesforceEng/tough-cookie/issues/comments/105768565","html_url":"https://github.com/SalesforceEng/tough-cookie/pull/42#issuecomment-105768565","issue_url":"https://api.github.com/repos/SalesforceEng/tough-cookie/issues/42","id":105768565,"user":{"login":"apsavin","id":632171,"avatar_url":"https://avatars.githubusercontent.com/u/632171?v=3","gravatar_id":"","url":"https://api.github.com/users/apsavin","html_url":"https://github.com/apsavin","followers_url":"https://api.github.com/users/apsavin/followers","following_url":"https://api.github.com/users/apsavin/following{/other_user}","gists_url":"https://api.github.com/users/apsavin/gists{/gist_id}","starred_url":"https://api.github.com/users/apsavin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apsavin/subscriptions","organizations_url":"https://api.github.com/users/apsavin/orgs","repos_url":"https://api.github.com/users/apsavin/repos","events_url":"https://api.github.com/users/apsavin/events{/privacy}","received_events_url":"https://api.github.com/users/apsavin/received_events","type":"User","site_admin":false},"created_at":"2015-05-27T06:07:50Z","updated_at":"2015-05-27T06:07:50Z","body":"Why somebody will want to use custom properties?"}}