In my frontend react application, I am trying to check if a session cookie exists, as this will help me decide whether to show a login page (if no session cookie exists or invalidated), or show content page.
The backend express-session middleware sets a cookie with a name "connect.sid". When I query the presence of this cookie with js-cookie, it shows as undefined. But I know this cookie exists. I also created another cookie programmatically from the browser console. While I am able to successfully query the cookie which I set programmatically from browser console window, I am unable to find the first one.
Here is the screenshot to show the available cookies.
And here is my test for both cookies from browser console.
I am unable to figure it out, why querying for "connect.sid" is failing. Can someone help me, where I am going wrong here...