{"action":"created","issue":{"url":"https://api.github.com/repos/meteor/meteor/issues/3574","labels_url":"https://api.github.com/repos/meteor/meteor/issues/3574/labels{/name}","comments_url":"https://api.github.com/repos/meteor/meteor/issues/3574/comments","events_url":"https://api.github.com/repos/meteor/meteor/issues/3574/events","html_url":"https://github.com/meteor/meteor/issues/3574","id":55729683,"number":3574,"title":"Allow object arg to `Session.set`","user":{"login":"lorensr","id":251288,"avatar_url":"https://avatars.githubusercontent.com/u/251288?v=3","gravatar_id":"","url":"https://api.github.com/users/lorensr","html_url":"https://github.com/lorensr","followers_url":"https://api.github.com/users/lorensr/followers","following_url":"https://api.github.com/users/lorensr/following{/other_user}","gists_url":"https://api.github.com/users/lorensr/gists{/gist_id}","starred_url":"https://api.github.com/users/lorensr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorensr/subscriptions","organizations_url":"https://api.github.com/users/lorensr/orgs","repos_url":"https://api.github.com/users/lorensr/repos","events_url":"https://api.github.com/users/lorensr/events{/privacy}","received_events_url":"https://api.github.com/users/lorensr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-28T08:57:20Z","updated_at":"2015-01-28T14:54:33Z","closed_at":null,"body":"[FR] Sometimes I have long lists of:\r\n\r\n```js\r\nSession.set 'foo', yes\r\nSession.set 'bar', 0\r\nSession.set 'foobar', 'hi'\r\n```\r\n\r\nWould be nice to overload first arg so I could set multiple at once:\r\n\r\n```js\r\nSession.set \r\n  foo: yes\r\n  bar: 0\r\n  foobar: 'hi'\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/meteor/meteor/issues/comments/71846998","html_url":"https://github.com/meteor/meteor/issues/3574#issuecomment-71846998","issue_url":"https://api.github.com/repos/meteor/meteor/issues/3574","id":71846998,"user":{"login":"awatson1978","id":675910,"avatar_url":"https://avatars.githubusercontent.com/u/675910?v=3","gravatar_id":"","url":"https://api.github.com/users/awatson1978","html_url":"https://github.com/awatson1978","followers_url":"https://api.github.com/users/awatson1978/followers","following_url":"https://api.github.com/users/awatson1978/following{/other_user}","gists_url":"https://api.github.com/users/awatson1978/gists{/gist_id}","starred_url":"https://api.github.com/users/awatson1978/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awatson1978/subscriptions","organizations_url":"https://api.github.com/users/awatson1978/orgs","repos_url":"https://api.github.com/users/awatson1978/repos","events_url":"https://api.github.com/users/awatson1978/events{/privacy}","received_events_url":"https://api.github.com/users/awatson1978/received_events","type":"User","site_admin":false},"created_at":"2015-01-28T14:54:33Z","updated_at":"2015-01-28T14:54:33Z","body":"There is a [session-extended-api](https://github.com/awatson1978/session-extended-api) package that provides ``toggle()`` and ``clear()`` functions, and is intended as a place to try these kinds of requests.  We could take a look at adding this functionality there.  I had been planning on updating it this week and making sure it was , and could implement this fairly quickly.  \r\n\r\nThe biggest issue with this proposal that I see is that ``Session.set()`` already takes an object (EJSON, I think), and disambiguating between setting an object to a variable and setting multiple variables.\r\n\r\nI'd be prone to follow the ``Session.setDefault()`` naming schema, and implement this as ``Session.setMultiple()``, like so:\r\n\r\n````js\r\nSession.setMultiple({\r\n  foo: true,\r\n  bar: 0,\r\n  foobar: 'hi'\r\n});\r\n````\r\n\r\nAnd you should be able to get the above syntax via the coffeescript compiler.\r\n"}}