function logout(req, res) {
  var email = req.session.email;
  req.logout();
  req.session.destroy(() => {
    res.clearCookie(process.env.SESSION_COOKIE_NAME);
    res.status(301).redirect((email)?'/session/set?s=email&v='+email:'/login');
  });
}

module.exports = {
  logout,
};
