protected HazelcastHttpSession createNewSession(HazelcastRequestWrapper requestWrapper, boolean create, String existingSessionId) { // use existing hazelcast session id for the new session only if the session info exists in the cluster boolean sessionExistsInTheCluster = sessionExistsInTheCluster(existingSessionId); if (!create && !sessionExistsInTheCluster) { return null; } String id = sessionExistsInTheCluster ? existingSessionId : generateSessionId(); if (requestWrapper.getOriginalSession(false) != null) { LOGGER.finest("Original session exists!!!"); } HttpSession originalSession = requestWrapper.getOriginalSession(true); HazelcastHttpSession hazelcastSession = createHazelcastHttpSession(id, originalSession); if (existingSessionId == null) { hazelcastSession.setClusterWideNew(true); // If the session is being created for the first time, add its initial reference in the cluster-wide map. } updateSessionMaps(originalSession.getId(), hazelcastSession); addSessionCookie(requestWrapper, id); return hazelcastSession; }
protected HazelcastHttpSession createNewSession(HazelcastRequestWrapper requestWrapper, boolean create, String existingSessionId) { // use existing hazelcast session id for the new session only if the session info exists in the cluster boolean sessionExistsInTheCluster = sessionExistsInTheCluster(existingSessionId); if (!create && !sessionExistsInTheCluster) { return null; } String id = sessionExistsInTheCluster ? existingSessionId : generateSessionId(); if (requestWrapper.getOriginalSession(false) != null) { LOGGER.finest("Original session exists!!!"); } HttpSession originalSession = requestWrapper.getOriginalSession(true); HazelcastHttpSession hazelcastSession = createHazelcastHttpSession(id, originalSession); if (existingSessionId == null) { hazelcastSession.setClusterWideNew(true); // If the session is being created for the first time, add its initial reference in the cluster-wide map. } updateSessionMaps(id, originalSession, hazelcastSession); addSessionCookie(requestWrapper, id); return hazelcastSession; }