I’ve just written a post about this subject where I encountered these issues. You can find it here: Cookie issues with Passport: why are cookies not sent/stored?
For me, the reason was a missing header in my Nginx configuration:
proxy_set_header X-Forwarded-Proto $scheme;
Without this configuration, the Set-Cookie
header cannot be sent.