Fix cookie decode function