Fix configuration of session ID generator on Tomcat 7
See gh-6679
This commit is contained in:
@@ -19,6 +19,7 @@ package org.springframework.boot.context.embedded.tomcat;
|
||||
import org.apache.catalina.Container;
|
||||
import org.apache.catalina.Manager;
|
||||
import org.apache.catalina.core.StandardContext;
|
||||
import org.apache.catalina.session.ManagerBase;
|
||||
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
@@ -52,8 +53,8 @@ class TomcatEmbeddedContext extends StandardContext {
|
||||
|
||||
@Override
|
||||
public void setManager(Manager manager) {
|
||||
if (manager != null) {
|
||||
manager.setSessionIdGenerator(new LazySessionIdGenerator());
|
||||
if (manager instanceof ManagerBase) {
|
||||
((ManagerBase) manager).setSessionIdGenerator(new LazySessionIdGenerator());
|
||||
}
|
||||
super.setManager(manager);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user