Catch index out of range in malformed cookie