Cookie with . (dot) in name

postman desktop app 7.2.2, macOS 10.14.4

A cookie with . (dot) in its name is not available in pm.cookies and breaks a smiple test

To Reproduce
When I get a cookie named PF, it is made available in pm.cookies such I can test its presence with

pm.test("cookie was dropped", function(){

However, when I get a cookie named PF.PERSISTENT, that same test no longer works and I have to rewrite it to use the following:

pm.test("cookie was dropped (getResponseHeader method)",function(){

Expected behavior
I would expect this test to work

pm.test("cookie was dropped (pm.cookies method)", function(){

Is my expectation that this should work wrong?

Hey @arnaudlacour,

Welcome to the Postman community :rocket:

I’m not completely sure what’s going on here and what your exact flow is within the app - Are you able to share more information about what you can see in the Postman Console, for that request? The more details you can give, the quicker we can get to a solution.

I set up a quick local server that sends a cookie with that name and the Test that you expected to work, is working for me on the macOS native app running version 7.3.4.

Maybe it is a timing issue.
in the screenshot below, you can see both PF and PF.PERSISTENT cookies being set

here is the extract from the tests that is checking for the presence of PF.PERSISTENT:

pm.test("cookie was dropped (pm.cookies method, single quotes)", function(){
pm.test("cookie was dropped (pm.cookies method, double quotes)", function(){

console.log("pm.cookies        =>"+JSON.stringify(pm.cookies.toObject()));
console.log("Set-Cookie Header => " + postman.getResponseHeader("Set-Cookie"));
pm.test("cookie was dropped (getResponseHeader method)",function(){

The first two tests fail, the third works.
I can only infer that my expectation that pm.cookies would be populated with 2 keys "pf{ and “PF.PERSISTENT” is incorrect at least at that point, or maybe in the test sandbox ?

Let me rephrase the question then:
Should we expect that
a) the Set-Cookie header has PF.PERSISTENT=....
b) pm.expect(postman.getResponseHeader("Set-Cookie")).to.include("PF.PERSISTENT=") passes
c) pm.expect(pm.cookies.has('PF.PERSISTENT')) should pass ???