i think the best way to expires the cookie is to just make the token null and set the expire time to now #code
res.cookie("token", null, { expires: new Date(Date.now() - 1000), httpsOnly: true, }