fix cookie issue on repeated authentication