Session session = sessionManager.getSession(exchange, c);
if (session != null) {
httpSession = new HttpSessionImpl(session, this, getDeployment().getApplicationListeners(), exchange, false);
exchange.putAttachment(sessionAttachmentKey, httpSession);
} else if (create) {
final Session newSession = sessionManager.createSession(exchange, c);
httpSession = new HttpSessionImpl(newSession, this, getDeployment().getApplicationListeners(), exchange, true);
exchange.putAttachment(sessionAttachmentKey, httpSession);
getDeployment().getApplicationListeners().sessionCreated(httpSession);
}
}