I'm using PassportJS
and this code for logout:
.get("/logout", async (req, res) => {
await req.logout();
req.session = null;
await res.clearCookie(process.env.PROJECT_TITLE.toLowerCase());
await res.clearCookie(`${process.env.PROJECT_TITLE.toLowerCase()}.sig`);
return res.redirect("/");
});
It just changes the cookies but don't delete them. Why?
It does delete them if I use just this code:
.get("/logout", async (req, res) => {
await res.clearCookie(process.env.PROJECT_TITLE.toLowerCase());
await res.clearCookie(`${process.env.PROJECT_TITLE.toLowerCase()}.sig`);
return res.redirect("/");
});
Where am I wrong?