Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Delete entire session on logout

  • Loading branch information...
commit ed54b45ff3e5558506c062a367f736a77e4c9c0e 1 parent 0f5a34a
@isaacs isaacs authored
Showing with 6 additions and 8 deletions.
  1. +6 −8 routes/logout.js
View
14 routes/logout.js
@@ -4,14 +4,12 @@ module.exports = function (req, res) {
req.couch.logout(next)
function next () {
- // delete the couchdb session, if we have one.
- req.session.del('name')
- req.session.del('error')
- res.cookies.set('name', '')
- req.session.del('profile', function (er) {
- if (er) return res.error(er)
- req.session.get('done', function (er, done) {
- res.redirect(done || '/')
+ // delete the whole session
+ req.session.get('done', function (er, done) {
+ done = done || '/'
+ req.session.del(function (er) {
+ if (er) return res.error(er)
+ res.redirect(done)
})
})
}
Please sign in to comment.
Something went wrong with that request. Please try again.