Quiz Question 1 of 3
Given the user authentication system we've built in this course, which code snippet shows a simple way to log a user out.
Choose the correct answer below:
-
A
router.get('/logout', function(req, res) { res.clearCookie('express.sid', { path: '/' }); });
-
B
router.get('/logout', function(req, res) { if (req.session) { req.session.destroy(function() { return res.redirect('/'); }); } });
-
C
router.get('/logout', function(req, res) { return res.send('User logged out.'); });