window.unload = function() {
let xhr = new XMLHttpRequest();
xhr.open('GET', '/user/sessionDestroy');
xhr.send();
};
router.get('/sessionDestroy', (req, res) => {
console.log(1);
req.session.destroy();
res.status(200).send('ok');
})