revised user login & logout functions.