centralize session id/pwd reset code