From 33a7c010c8d02ff7a9e5b0b1604d67d7255d0b4d Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Thu, 25 Aug 2016 12:52:00 -0400 Subject: [PATCH] Destroy a session --- node.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/node.md b/node.md index adaba3c..df25d66 100644 --- a/node.md +++ b/node.md @@ -312,6 +312,14 @@ To get data, simply run: var userData = req.session.userData; ``` +To destroy a session: + +```javascript +req.session.destroy(function(){ + //do something once session destroy succeeds +}); +``` + ## Bcrypt To encrypt information, we `npm install bcrypt --save` and require it: