Fix set cookie bug