code: public void save(final boolean saveInSession, final U profile, final boolean multiProfile) {
          final LinkedHashMap<String, U> profiles;
  
          final String clientName = retrieveClientName(profile);
          if (multiProfile) {
              profiles = retrieveAll(saveInSession);
              profiles.remove(clientName);
          } else {
              profiles = new LinkedHashMap<>();
          }
          profiles.put(clientName, profile);
  
          if (saveInSession) {
              this.sessionStore.set(this.context, Pac4jConstants.USER_PROFILES, profiles);
          }
          this.context.setRequestAttribute(Pac4jConstants.USER_PROFILES, profiles);
      }
docs: Save the given user profile (replace the current one if multi profiles are not supported, add it otherwise).
  
  @param saveInSession if the user profile must be saved in session
  @param profile a given user profile
  @param multiProfile whether multiple profiles are supported