# Why I can still get cookies after clearing them?

**URL:** <https://community.postman.com/t/why-i-can-still-get-cookies-after-clearing-them/33337>\
**Category:** Help Hub\
**Tags:** cookies, test\
**Created:** [March 9, 2022, 3:42pm UTC](https://community.postman.com/t/why-i-can-still-get-cookies-after-clearing-them/33337 "2022-03-09T15:42:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![koshmariel](https://avatars.discourse-cdn.com/v4/letter/k/47e85d/32.png) [@koshmariel](https://community.postman.com/u/koshmariel)\
**Post date:** [March 9, 2022, 3:42pm UTC](https://community.postman.com/t/why-i-can-still-get-cookies-after-clearing-them/33337/1 "2022-03-09T15:42:27Z")

</div>

My code is:

```auto
var cookiesAll = pm.cookies.all();
console.log('cookiesBeforeClearing= ',cookiesAll);

//clear all cokies
const jar = pm.cookies.jar();
jar.clear(pm.request.url, function (error) {
// error - <Error>
});

var cookiesAll2 = pm.cookies.all();
console.log('cookiesAfterClearing= ',cookiesAll2);

```

It definitely works: after it’s execution there are no cookies in the Cookies tab. But in console I get them both times. Why is it happening?

 ![Screenshot 2022-03-09 at 19.42.16](https://us1.discourse-cdn.com/getpostman/original/3X/9/5/95eec8fea95ec9368bae61ba7c11b664be9ef8ba.png)

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [December 12, 2024, 12:54pm UTC](https://community.postman.com/t/why-i-can-still-get-cookies-after-clearing-them/33337/2 "2024-12-12T12:54:15Z")

</div>

Closed on December 12, 2024, 12:54pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
