Fixed - RedissonSession.setValid(false) can recreate Tomcat session. Session validity checking improved. #974

pull/1078/head
Nikita 7 years ago
parent 5519fdec48
commit e42c9c1c26

@ -113,6 +113,10 @@ public class RedissonSession extends StandardSession {
super.setValid(isValid);
if (map != null) {
if (!isValid && !map.isExists()) {
return;
}
map.fastPut("session:isValid", isValid);
}
}

@ -127,7 +127,7 @@ public class RedissonSessionManager extends ManagerBase implements Lifecycle {
Session result = super.findSession(id);
if (result == null && id != null) {
Map<String, Object> attrs = getMap(id).readAllMap();
if (attrs.isEmpty()) {
if (attrs.isEmpty() || !Boolean.valueOf(String.valueOf(attrs.get("session:isValid")))) {
log.info("Session " + id + " can't be found");
return null;
}

@ -117,6 +117,10 @@ public class RedissonSession extends StandardSession {
super.setValid(isValid);
if (map != null) {
if (!isValid && !map.isExists()) {
return;
}
map.fastPut("session:isValid", isValid);
}
}

@ -105,7 +105,7 @@ public class RedissonSessionManager extends ManagerBase {
Session result = super.findSession(id);
if (result == null && id != null) {
Map<String, Object> attrs = getMap(id).readAllMap();
if (attrs.isEmpty()) {
if (attrs.isEmpty() || !Boolean.valueOf(String.valueOf(attrs.get("session:isValid")))) {
log.info("Session " + id + " can't be found");
return null;
}

@ -118,6 +118,10 @@ public class RedissonSession extends StandardSession {
super.setValid(isValid);
if (map != null) {
if (!isValid && !map.isExists()) {
return;
}
map.fastPut("session:isValid", isValid);
}
}

@ -105,7 +105,8 @@ public class RedissonSessionManager extends ManagerBase {
Session result = super.findSession(id);
if (result == null && id != null) {
Map<String, Object> attrs = getMap(id).readAllMap();
if (attrs.isEmpty()) {
if (attrs.isEmpty() || !Boolean.valueOf(String.valueOf(attrs.get("session:isValid")))) {
log.info("Session " + id + " can't be found");
return null;
}

Loading…
Cancel
Save