Fixed - Spring session ID change doesn't work in Redis cluster #1897

pull/1933/head
Nikita Koksharov 6 years ago
parent 584cb7c151
commit 8610d60b0c

@ -216,7 +216,14 @@ public class RedissonSessionRepository implements FindByIndexNameSessionReposito
@Override @Override
public String changeSessionId() { public String changeSessionId() {
String id = delegate.changeSessionId(); String id = delegate.changeSessionId();
map.rename(keyPrefix + id); if (redisson.getConfig().isClusterConfig()) {
Map<String, Object> oldState = map.readAllMap();
map.delete();
map = redisson.getMap(keyPrefix + id, map.getCodec());
map.putAll(oldState);
} else {
map.rename(keyPrefix + id);
}
return id; return id;
} }

Loading…
Cancel
Save