Fix cookie save & logout