title: Session not getting destroyed in nodejs
body: <p>I am using the code as stated below to logout from my site created using nodejs and mysql but its simply redirecting to the login page without destroying the session. Even after logging out I can visit other pages of the site. I want my session to be destroyed on logout and it should ask to login to visit the pages of the website.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>router.get('/logout', function(req, res) {
      req.session.destroy((err) =&gt; {
          if (err) {
              console.log(err)
              return next(err)
          }
  
          return res.redirect("/")
      })
    
    });</code></pre>
  </div>
  </div>
  </p>