docs: @Nullable
    @DevelopersNote ("This is only for project-internal use!")
    public static ISessionWebScope internalGetOrCreateSessionScope (@Nonnull final HttpSession aHttpSession,
                                                                    final boolean bCreateIfNotExisting,
                                                                    final boolean bItsOkayToCreateANewScope)
    {
      ValueEnforcer.notNull (aHttpSession, "HttpSession");
  
      // Do we already have a session web scope for the session?
      final String sSessionID = aHttpSession.getId ();
      ISessionScope aSessionWebScope = ScopeSessionManager.getInstance ().getSessionScopeOfID (sSessionID);
      if (aSessionWebScope == null && bCreateIfNotExisting)
      {
        if (!bItsOkayToCreateANewScope)
        {
          // This can e.g. happen in tests, when there are no registered
          // listeners for session events!
          if (LOGGER.isWarnEnabled ())
            LOGGER.warn ("Creating a new session web scope for ID '" +
                            sSessionID +
                            "' but there should already be one!" +
                            " Check your HttpSessionListener implementation.");
        }
  
        // Create a new session scope
        aSessionWebScope = onSessionBegin (aHttpSession);
      }
  
      try
      {
        return (ISessionWebScope) aSessionWebScope;
      }
      catch (final ClassCastException ex)
      {
        throw new IllegalStateException ("Session scope object is not a web scope but: " + aSessionWebScope, ex);
      }
    }