public void invalidate() { // we must invalidate hazelcast session first // invalidating original session will trigger another // invalidation as our SessionListener will be triggered. webFilter.destroySession(this, true); originalSession.invalidate(); invalidatedOriginalSessionId = originalSession.getId(); }
public void invalidate() { // we must invalidate hazelcast session first // invalidating original session will trigger another // invalidation as our SessionListener will be triggered. webFilter.destroySession(this, true); originalSession.invalidate(); invalidatedOriginalSessionId = originalSession.getId(); }
void destroyOriginalSession(HttpSession originalSession) { String hazelcastSessionId = originalSessions.remove(originalSession.getId()); if (hazelcastSessionId != null) { HazelcastHttpSession hazelSession = sessions.get(hazelcastSessionId); if (hazelSession != null) { destroySession(hazelSession, false); } } }
void destroyOriginalSession(HttpSession originalSession) { String hazelcastSessionId = originalSessions.remove(originalSession.getId()); if (hazelcastSessionId != null) { HazelcastHttpSession hazelSession = sessions.get(hazelcastSessionId); if (hazelSession != null) { destroySession(hazelSession, false); } } }
private HazelcastHttpSession getSessionWithId(final String sessionId) { HazelcastHttpSession session = sessions.get(sessionId); if (session != null && !session.isValid()) { destroySession(session, true); session = null; } return session; }
private HazelcastHttpSession getSessionWithId(final String sessionId) { HazelcastHttpSession session = sessions.get(sessionId); if (session != null && !session.isValid()) { destroySession(session, true); session = null; } return session; }
if (hazelcastSession != null && !hazelcastSession.isValid()) { LOGGER.finest("Session is invalid!"); destroySession(hazelcastSession, true); invalidatedOriginalSessionId = hazelcastSession.invalidatedOriginalSessionId; hazelcastSession = null;
if (hazelcastSession != null && !hazelcastSession.isValid()) { LOGGER.finest("Session is invalid!"); destroySession(hazelcastSession, true); invalidatedOriginalSessionId = hazelcastSession.invalidatedOriginalSessionId; hazelcastSession = null;
@Override protected void destroySession(HazelcastHttpSession session, boolean invalidate) { super.destroySession(session, invalidate); if (invalidate) { ApplicationContext appContext = WebApplicationContextUtils.getWebApplicationContext(servletContext); if (appContext != null) { ensureSessionRegistryInitialized(appContext); if (sessionRegistry != null) { String originalSessionId = session.getOriginalSessionId(); // If original session id is registered already, we don't need it. // So, we should remove it also. sessionRegistry.removeSessionInformation(originalSessionId); /** * Publish an event to notify * {@link org.springframework.security.core.session.SessionRegistry} instance. * So Spring clears information about our Hazelcast session. */ appContext.publishEvent(new HttpSessionDestroyedEvent(session)); LOGGER.finest("Published destroy session event for Spring for session with id " + session.getId()); } } } }
@Override protected void destroySession(HazelcastHttpSession session, boolean invalidate) { super.destroySession(session, invalidate); if (invalidate) { ApplicationContext appContext = WebApplicationContextUtils.getWebApplicationContext(servletContext); if (appContext != null) { ensureSessionRegistryInitialized(appContext); if (sessionRegistry != null) { String originalSessionId = session.getOriginalSessionId(); // If original session id is registered already, we don't need it. // So, we should remove it also. sessionRegistry.removeSessionInformation(originalSessionId); /** * Publish an event to notify * {@link org.springframework.security.core.session.SessionRegistry} instance. * So Spring clears information about our Hazelcast session. */ appContext.publishEvent(new HttpSessionDestroyedEvent(session)); LOGGER.finest("Published destroy session event for Spring for session with id " + session.getId()); } } } }