Fix connection when no cookie is given

This patch corrects a regression introduced in 2edd8bee1208aef77f92209f737c376063681bf7