-
1. Re: custom JSESSION cookie name, is this supported?
pferraro Apr 4, 2012 12:53 PM (in response to aaronbell)Yes, but there is some work involved.
Within the container-spi module is the relevant method: org.jboss.modcluster.container.Engine.getSessionCookieName().
You'll need to create a custom Engine and EngineFactory implementation and indicate the location of your EngineFactory within a file that can be found by the service loader.
e.g.
public class CustomEngine extends TomcatEngine { // You'll want to override the impl you currently use
public CustomEngine(CatalinaFactoryRegistry registry, Engine engine, Server server) {
super(registry, engine, server);
}
@Override
public String getSessionCookieName() {
return "FOOSESSIONID";
}
}
public class CustomEngineFactory implements EngineFactory {
@Override
public Engine createEngine(CatalinaFactoryRegistry registry, org.apache.catalina.Engine engine, Server server) {
return new CustomEngine(registry, engine, server);
}
}
Then bundle this class with a META-INF/services/org.jboss.modcluster.container.catalina.EngineFactory file that indicates the fully qualified class name of your CustomEngineFactory class.
That should do it.
-
2. Re: custom JSESSION cookie name, is this supported?
edwinb1 Apr 4, 2012 1:36 PM (in response to pferraro)Does this apply on a per 'LBGroup' basis? In other words, can each registered LBGroup declare its own distinct session cookie name or do all LBGroups have to employ the same name?
Thanks,
Edwin
-
3. Re: custom JSESSION cookie name, is this supported?
jfclere Apr 4, 2012 1:50 PM (in response to pferraro)That could make sense to open a JIRA. jbossweb uses org.apache.catalina.JSESSIONID/jsessionid to set a different value, we should do the same.
-
4. Re: custom JSESSION cookie name, is this supported?
rhusar Apr 6, 2012 10:42 AM (in response to jfclere)Filed https://issues.jboss.org/browse/AS7-4424 lets see.
-
5. Re: custom JSESSION cookie name, is this supported?
pferraro Apr 6, 2012 12:49 PM (in response to jfclere)Actually, the mod_cluster-container-jbossweb and mod_cluster-container-tomcat6 modules already obtain the session cookie/paramater name from this system property (see the Engine.getSessionCookieName() and getSessionParameterName() methods). The mod_cluster-container-tomcat7 module does not (and instead always uses a constant value). Tomcat 7 allows this to be overridden per web application context - which is not compatible with mod_cluster since we send this value to the load balancer for all web apps (i.e. per Engine) - not per web app.