Add test for setCookie regression

See #1031, #1121, #1092