# Cannot access cookie "connect.sid"

**URL:** <https://community.postman.com/t/cannot-access-cookie-connect-sid/10643>\
**Category:** Help Hub\
**Created:** [February 6, 2020, 9:44pm UTC](https://community.postman.com/t/cannot-access-cookie-connect-sid/10643 "2020-02-06T21:44:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mab1618](https://avatars.discourse-cdn.com/v4/letter/m/dfb087/32.png) [@mab1618](https://community.postman.com/u/mab1618)\
**Post date:** [February 6, 2020, 9:44pm UTC](https://community.postman.com/t/cannot-access-cookie-connect-sid/10643/1 "2020-02-06T21:44:47Z")

</div>

I am trying to use chained request to mimic the flow of logging in to our application and then formulating a POST command. In the response header of my login request, there is **Set-Cookie** that sets two cookies named \_csrf and connect.sid. I need to use both of these cookies for my subsequent chained POST request, however I only seem to have visibility to the \_csrf cookie.

If I use

```
postman.getResponseHeader("Set-Cookie"))

```

the result is something like

```
{_csrf: "Gs2Bdmb_Yy7om3zkdON2-Erf"}

```

Yet when I perform the same request in my browser, I see both cookies.

![image](https://us1.discourse-cdn.com/getpostman/original/2X/d/d7605f6f7ab8ce6c1706037f78fe8b1972dc0b72.png)

Why is this cookie not visible in Postman?

Thanks for any help.

---

<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 7, 2020, 7:49am UTC](https://community.postman.com/t/cannot-access-cookie-connect-sid/10643/2 "2020-02-07T07:49:37Z")

</div>

@mab1618 can you check if the cookie is having “Secure” flag ?  
Is “connect.sid” saved to your cookie jar ? check Manage cookies in postman.

---

<div class="post-metadata">

**Author:** ![mab1618](https://avatars.discourse-cdn.com/v4/letter/m/dfb087/32.png) [@mab1618](https://community.postman.com/u/mab1618)\
**Post date:** [February 7, 2020, 3:02pm UTC](https://community.postman.com/t/cannot-access-cookie-connect-sid/10643/3 "2020-02-07T15:02:52Z")

</div>

Yes, both cookies have a secure flag.

I wasn’t sure that I needed to implement a cookie jar since I am only trying to harvest the cookie values from a Response to use in subsequent Requests. I am not creating any new cookies. I thought, maybe incorrectly, that using pm.getResponseHeader to store the values in variables or just having Postman natively use the cookies would be adequate. In both cases, only the \_csrf cookie is available in the getResponseHeader method and in the “Cookies” section of the response in the Postman UI after my login request. Also, I don’t actually see the “Set-Cookie” property in the Postman UI or Postman console in the Response, but the pm.getResponseHeader(“Set-Cookie”) returns the results I mentioned in my original post.

When I perform the same request in my browser and view the Response header, I see the Set-Cookie property with both cookies in it. When I view the cookies in browser console, both of the cookies are there.

---

<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 10, 2020, 7:36am UTC](https://community.postman.com/t/cannot-access-cookie-connect-sid/10643/4 "2020-02-10T07:36:42Z")

</div>

@mab1618 you have to use pm.cookies to access any cookie programatically.  
Refer the documentation here: [https://learning.postman.com/docs/postman/sending-api-requests/cookies/#programmatic-access-of-cookies](https://learning.postman.com/docs/postman/sending-api-requests/cookies/#programmatic-access-of-cookies)

Postman has an existing bug related to accessing secure cookies: [https://github.com/postmanlabs/postman-app-support/issues/7977](https://github.com/postmanlabs/postman-app-support/issues/7977)

I have found a temporary workaround i accessing a secure cookie using pm.cookies.jar()  
Refer this: [https://stackoverflow.com/questions/60001892/pm-cookies-jar-could-not-find-cookies-with-secure-true/60077320](https://stackoverflow.com/questions/60001892/pm-cookies-jar-could-not-find-cookies-with-secure-true/60077320)
