Fixing cookie setting problems