我的应用是由node和express搭建的,执行下面代码,其中 xxxxx 是 httpOnly 的,结果是:uname 删除了,xxxxx没有被删除。所以,不能删除 httpOnly 的 Cookie?
res.clearCookie('uname'); res.clearCookie('xxxxx');
业精于勤,荒于嬉;行成于思,毁于随。
Add your path, for example
res.clearCookie('xxxxx', { path: '/' });
If that doesn’t work, set the expiration time to -1
res.cookie('xxxxx', '', { expires: -1, path: '/' });
httponly js cannot be read or deleted
I haven’t tried this, but it seems that after setting httpOnly, the cookie content cannot be read by using document.cookie in the browser console.
Add your path, for example
If that doesn’t work, set the expiration time to -1
httponly js cannot be read or deleted
I haven’t tried this, but it seems that after setting httpOnly, the cookie content cannot be read by using document.cookie in the browser console.