{"action":"closed","issue":{"url":"https://api.github.com/repos/QubitProducts/cookieman/issues/14","repository_url":"https://api.github.com/repos/QubitProducts/cookieman","labels_url":"https://api.github.com/repos/QubitProducts/cookieman/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/QubitProducts/cookieman/issues/14/comments","events_url":"https://api.github.com/repos/QubitProducts/cookieman/issues/14/events","html_url":"https://github.com/QubitProducts/cookieman/issues/14","id":158696774,"number":14,"title":"Set expiry as a length of time","user":{"login":"KwanMan","id":1779673,"avatar_url":"https://avatars.githubusercontent.com/u/1779673?v=3","gravatar_id":"","url":"https://api.github.com/users/KwanMan","html_url":"https://github.com/KwanMan","followers_url":"https://api.github.com/users/KwanMan/followers","following_url":"https://api.github.com/users/KwanMan/following{/other_user}","gists_url":"https://api.github.com/users/KwanMan/gists{/gist_id}","starred_url":"https://api.github.com/users/KwanMan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KwanMan/subscriptions","organizations_url":"https://api.github.com/users/KwanMan/orgs","repos_url":"https://api.github.com/users/KwanMan/repos","events_url":"https://api.github.com/users/KwanMan/events{/privacy}","received_events_url":"https://api.github.com/users/KwanMan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-06-06T14:50:24Z","updated_at":"2016-06-07T15:25:02Z","closed_at":"2016-06-07T15:25:02Z","body":"99% of the times I set a cookie, the expiry is a specific amount of time from now (e.g. 1 day, 1 year) and currently need to calculate that every time.\r\n\r\n`new Date((new Date()).getTime() + (365 * 24 * 60 * 60 * 1000))`\r\n\r\nWould be great to have an option to pass in a length of time rather than a date object\r\n\r\nWould either be\r\n1/ `options.expiresIn = 365 * 24 * 60 * 60 * 1000` - But this might cause confusion as to which takes precedent if both `option.expires` and `option.expiresIn` is set\r\n\r\n2/  if `options.expires` is an integer, treat it as a time period and add it to the current time to get the expiry date - May also cause confusion since passing different types does significantly different things\r\n\r\n@alanclarke ?"}}
{"actor":{"display_login":"alanclarke"}}