use of com.networknt.session.Session in project light-session-4j by networknt.
the class RedisSessionManager method getSession.
@Override
public Session getSession(final HttpServerExchange serverExchange) {
if (serverExchange != null) {
RedisSessionRepository.RedisSession newSession = serverExchange.getAttachment(NEW_SESSION);
if (newSession != null) {
return newSession;
}
}
String sessionId = sessionConfig.findSessionId(serverExchange);
Session session = getSession(sessionId);
if (session == null) {
sessionConfig.clearSession(serverExchange, sessionId);
}
return session;
}
use of com.networknt.session.Session in project light-session-4j by networknt.
the class RedisSessionManager method removeSession.
@Override
public Session removeSession(HttpServerExchange serverExchange) {
if (serverExchange != null) {
String sessionId = sessionConfig.findSessionId(serverExchange);
Session oldSession = serverExchange.removeAttachment(NEW_SESSION);
removeSession(sessionId);
return oldSession;
}
return null;
}
Aggregations