Fix bad cookie behaviour