Added better cookie corruption handling