create/reset session in login function