fix a bug when destroy cookie