Skip to content

Commit

Permalink
Make configuration of lazy session ID generator compatible with Tomcat 7
Browse files Browse the repository at this point in the history
  • Loading branch information
wilkinsona committed Jun 17, 2016
1 parent f0ce0e3 commit f5f116d
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.apache.catalina.Wrapper;
import org.apache.catalina.connector.Connector;
import org.apache.catalina.loader.WebappLoader;
import org.apache.catalina.session.ManagerBase;
import org.apache.catalina.session.StandardManager;
import org.apache.catalina.startup.Tomcat;
import org.apache.catalina.startup.Tomcat.FixContextListener;
Expand Down Expand Up @@ -815,8 +816,9 @@ public void lifecycleEvent(LifecycleEvent event) {
if (event.getType().equals(Lifecycle.START_EVENT)) {
Context context = (Context) event.getLifecycle();
Manager manager = context.getManager();
if (manager != null) {
manager.setSessionIdGenerator(new LazySessionIdGenerator());
if (manager instanceof ManagerBase) {
((ManagerBase) manager)
.setSessionIdGenerator(new LazySessionIdGenerator());
}
}
}
Expand Down

0 comments on commit f5f116d

Please sign in to comment.