@Override
	public void sessionCreated(HttpSessionEvent event) {
		if (!instanceEnabled) {
			return;
		}
		// pour être notifié des passivations et activations, on enregistre un HttpSessionActivationListener (this)
		final HttpSession session = event.getSession();
		// Since tomcat 6.0.21, because of https://issues.apache.org/bugzilla/show_bug.cgi?id=45255
		// when tomcat authentication is used, sessionCreated is called twice for 1 session
		// and each time with different ids, then sessionDestroyed is called once.
		// So we do not count the 2nd sessionCreated event and we remove the id of the first event.

		// And (issue #795), in Tomcat's cluster after one instance restart
		// sessions are synced with sessionDidActivate+sessionCreated
		// so do not increment count for sessionCreated when session.getAttribute(SESSION_ACTIVATION_KEY) != null
		// (but not == this because of deserialization)
		if (session.getAttribute(SESSION_ACTIVATION_KEY) != null) {
			// si la map des sessions selon leurs id contient une session dont la clé
			// n'est plus égale à son id courant, alors on l'enlève de la map
			// (et elle sera remise dans la map avec son nouvel id ci-dessous)
			removeSessionsWithChangedId();
		} else {
			session.setAttribute(SESSION_ACTIVATION_KEY, this);

			// pour getSessionCount
			SESSION_COUNT.incrementAndGet();
		}

		// pour invalidateAllSession
		addSession(session);
	}
@Test
	public void testSessionCreated() {
		final HttpSessionEvent sessionEvent = createSessionEvent();
		sessionListener.sessionCreated(sessionEvent);
		if (SessionListener.getSessionCount() != 1) {
			fail("sessionCreated");
		}
		if (SessionListener.getAllSessionsInformations().isEmpty()) {
			fail("sessionCreated");
		}
		sessionListener.sessionCreated(sessionEvent);
		if (SessionListener.getSessionCount() != 1) {
			fail("sessionCreated");
		}
	}