# Pm.cookies.jar could not find cookies with secure=true

**URL:** <https://community.postman.com/t/pm-cookies-jar-could-not-find-cookies-with-secure-true/10477>\
**Category:** Help Hub\
**Tags:** tests, cookies\
**Created:** [January 31, 2020, 9:48am UTC](https://community.postman.com/t/pm-cookies-jar-could-not-find-cookies-with-secure-true/10477 "2020-01-31T09:48:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeevananthank](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/jeevananthank/32/4075_2.png) [@jeevananthank](https://community.postman.com/u/jeevananthank)\
**Post date:** [January 31, 2020, 9:48am UTC](https://community.postman.com/t/pm-cookies-jar-could-not-find-cookies-with-secure-true/10477/1 "2020-01-31T09:48:32Z")

</div>

I have a list of cookies in my response that has secure=true which is not accessible by the pm.cookies.jar()

This results in an issue where i wanted to clear all the cookies under a domain, which does not happen with the below code on the secure cookies.

```
    const jar = pm.cookies.jar();
    var domain = pm.environment.get("envUrl");    
    jar.clear(domain, function (error){
        if(error)
        {
            console.log("error",error);
        }
    });
```

---

<div class="post-metadata">

**Author:** ![jeevananthank](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/jeevananthank/32/4075_2.png) [@jeevananthank](https://community.postman.com/u/jeevananthank)\
**Post date:** [February 3, 2020, 7:29am UTC](https://community.postman.com/t/pm-cookies-jar-could-not-find-cookies-with-secure-true/10477/2 "2020-02-03T07:29:21Z")

</div>

This seems to be a bug and a github issue has been created.

> <https://github.com/postmanlabs/postman-app-support/issues/7977>
>
> \*\*Describe the bug\*\*
> I have a list of cookies in my response that has secure=tr…ue which is not accessible by the pm.cookies.jar()
> 
> This results in an issue where i wanted to clear all the cookies under a domain, which does not happen with the below code on the secure cookies. 
> Issue opened after the comments from : https://stackoverflow.com/questions/60001892/pm-cookies-jar-could-not-find-cookies-with-secure-true
> 
> \*\*To Reproduce\*\*
> Steps to reproduce the behavior:
> 1. Send a request in Postman which returns cookies with secure =true and false.
> Test script: 
> \> const jar = pm.cookies.jar();
> var domain = pm.environment.get("envUrl");    
> jar.clear(domain, function (error){
> if(error){
> console.log("error",error);
> }});
> 3. After this script is run, i could see that the secure cookies are NOT cleared from the manage cookies window.
> 
> \*\*Expected behavior\*\*
> It is expected that pm.cookies.jar holds all the cookies irrespective of the secure flag.
> 
> \*\*Screenshots\*\*
> !\[image\](https://user-images.githubusercontent.com/49391725/73547954-4554c300-4440-11ea-88b0-587f524aae46.png)
> 
> \*\*App information (please complete the following information):\*\*
> Postman for Windows - Version 7.16.1 - win32 10.0.14393 / x64
