{"action":"created","issue":{"url":"https://api.github.com/repos/deployd/deployd/issues/551","labels_url":"https://api.github.com/repos/deployd/deployd/issues/551/labels{/name}","comments_url":"https://api.github.com/repos/deployd/deployd/issues/551/comments","events_url":"https://api.github.com/repos/deployd/deployd/issues/551/events","html_url":"https://github.com/deployd/deployd/issues/551","id":68170392,"number":551,"title":"New cookies auth throw exception","user":{"login":"ipepe","id":10695953,"avatar_url":"https://avatars.githubusercontent.com/u/10695953?v=3","gravatar_id":"","url":"https://api.github.com/users/ipepe","html_url":"https://github.com/ipepe","followers_url":"https://api.github.com/users/ipepe/followers","following_url":"https://api.github.com/users/ipepe/following{/other_user}","gists_url":"https://api.github.com/users/ipepe/gists{/gist_id}","starred_url":"https://api.github.com/users/ipepe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipepe/subscriptions","organizations_url":"https://api.github.com/users/ipepe/orgs","repos_url":"https://api.github.com/users/ipepe/repos","events_url":"https://api.github.com/users/ipepe/events{/privacy}","received_events_url":"https://api.github.com/users/ipepe/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/deployd/deployd/labels/severity:%20broken%20expected%20use","name":"severity: broken expected use","color":"fbca04"},{"url":"https://api.github.com/repos/deployd/deployd/labels/type:%20bug","name":"type: bug","color":"e10c02"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-04-13T19:08:33Z","updated_at":"2015-04-14T17:23:48Z","closed_at":"2015-04-14T11:28:41Z","body":"My deployd version is newest master branch\r\nI have application and i use dpd-event to login user with simple http form. This is code inside my dpd-event ON POST event:\r\n```javascript\r\nif( typeof parts !== 'undefined' ){\r\n    switch(parts[0]){\r\n        case 'userLogin':\r\n            dpd.users.login({username: body.username, password: body.password}, function(result,error){\r\n                ctx.res.statusCode = 302;\r\n                ctx.res.setHeader('Location', 'http://' + ctx.req.headers['host'] );\r\n            });\r\n            break;\r\n        default:\r\n            break;\r\n    }\r\n}\r\n```\r\nhtml/form\r\n```html\r\n<form class=\"pure-form\" action=\"/actions/userLogin\" method=\"post\" >\r\n    <input name=\"username\" type=\"email\" placeholder=\"email\" required=\"required\">\r\n    <br>\r\n    <input name=\"password\" type=\"password\" placeholder=\"password\" pattern=\".{8,}\" required title=\"min 8 chars\">\r\n    <br>\r\n    <button type=\"submit\">Confirm</button>\r\n</form>\r\n```\r\n\r\nThis is my error in console:\r\n```\r\nTypeError: Cannot read property 'set' of undefined\r\n    at /Users/.../nodeProjects/.../node_modules/deployd/lib/resources/user-collection.js:210:26\r\n```\r\n\r\nAnd this is code snip that is problematic:\r\n```javascript\r\n    function loginDone(err) {\r\n      if (err) return ctx.done(err);\r\n      checkAndSaveUser(function (err) {\r\n        if (err) return ctx.done(err);\r\n        debug('logged in as %s', credentials.username);\r\n        ctx.session.set({ path: path, uid: user.id, userhash: usernameAndPasswordHash }).save(function (err, session) {\r\n          if (err) return ctx.done(\"Internal error\");\r\n          //here cookies doesnt exist in ctx.res\r\n          ctx.res.cookies.set('sid', session.id, { overwrite: true });\r\n          ctx.done(err, { path: session.path, id: session.id, uid: session.uid });\r\n        });\r\n      });\r\n    }\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/deployd/deployd/issues/comments/92988468","html_url":"https://github.com/deployd/deployd/issues/551#issuecomment-92988468","issue_url":"https://api.github.com/repos/deployd/deployd/issues/551","id":92988468,"user":{"login":"ipepe","id":10695953,"avatar_url":"https://avatars.githubusercontent.com/u/10695953?v=3","gravatar_id":"","url":"https://api.github.com/users/ipepe","html_url":"https://github.com/ipepe","followers_url":"https://api.github.com/users/ipepe/followers","following_url":"https://api.github.com/users/ipepe/following{/other_user}","gists_url":"https://api.github.com/users/ipepe/gists{/gist_id}","starred_url":"https://api.github.com/users/ipepe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipepe/subscriptions","organizations_url":"https://api.github.com/users/ipepe/orgs","repos_url":"https://api.github.com/users/ipepe/repos","events_url":"https://api.github.com/users/ipepe/events{/privacy}","received_events_url":"https://api.github.com/users/ipepe/received_events","type":"User","site_admin":false},"created_at":"2015-04-14T17:23:48Z","updated_at":"2015-04-14T17:23:48Z","body":"It still doesn't work for me. Do You want me to create repository with app that will have this problem?"}}