Added cookie validation