public Session getCurrentSession(){ if ( currentSession == null ) currentSession = configuration.getSessionStore().createOrRetrieveSession(exchange, configuration.getSessionIdManager()); return currentSession; }
@Override public Session createOrRetrieveSession(HttpServerExchange exchange, SessionIdManager sessionIdManager) { final String sessionId = sessionIdManager.retrieveSessionIdFrom( exchange ); Session session = getSessionFromCache( sessionId ); if ( session == null && shouldNotStoreSession( exchange ) ) return new DefaultSession(SESSION_ID); else if ( session == null ) session = getSessionStore().createOrRetrieveSession(exchange, sessionIdManager); return session; }