Today I learned that cookies do not provide isolation by port.
I guess that’s because, in 30 years of web development, I had never locally tested multiple instances of a peer-to-peer web app that used cookies for sessions before.
PS. You can just test from different loopback addresses. e.g., 127.0.0.1:443, 127.0.0.2:444, etc. Of course, your local TLS certificate has to include those IPs or you’ll see certificate errors if testing over HTTPS.