Skip to content

Commit

Permalink
set a unique session id for each jetty instance. before the session i…
Browse files Browse the repository at this point in the history
…d was not unique for a server
  • Loading branch information
chenson42 committed Apr 26, 2012
1 parent ba20041 commit 30253c1
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -41,6 +41,7 @@
import org.eclipse.jetty.security.authentication.BasicAuthenticator;
import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.SessionManager;
import org.eclipse.jetty.server.bio.SocketConnector;
import org.eclipse.jetty.server.nio.SelectChannelConnector;
import org.eclipse.jetty.server.ssl.SslSocketConnector;
Expand Down Expand Up @@ -181,7 +182,9 @@ public SymmetricWebServer start(int port, int securePort, Mode mode) throws Exce
webapp.setParentLoaderPriority(true);
webapp.setContextPath(webHome);
webapp.setWar(webAppDir);
webapp.getSessionHandler().getSessionManager().setMaxInactiveInterval(maxIdleTime / 1000);
SessionManager sm = webapp.getSessionHandler().getSessionManager();
sm.setMaxInactiveInterval(maxIdleTime / 1000);
sm.setSessionCookie(sm.getSessionCookie() + port);
if (propertiesFile != null) {
webapp.getServletContext().setInitParameter(
WebConstants.INIT_SINGLE_SERVER_PROPERTIES_FILE, propertiesFile);
Expand Down

0 comments on commit 30253c1

Please sign in to comment.