node.js - 是不是不能删除 httpOnly 的 Cookie
迷茫
迷茫 2017-04-17 13:10:41
0
3
601

我的应用是由node和express搭建的,执行下面代码,其中 xxxxx 是 httpOnly 的,结果是:uname 删除了,xxxxx没有被删除。所以,不能删除 httpOnly 的 Cookie?

res.clearCookie('uname');
res.clearCookie('xxxxx');
迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(3)
大家讲道理

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: '/' });
PHPzhong

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!