Fixed cookie validation