Set Jetty session cookie name programmatically
I'm running in this issue , how can I set session cookie name by code in Jetty 8? ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS); sessionHandler = new SessionHandler(); sessionHandler.getSessionManager().setSessionCookie("JSESSIONID_"+runningPort); context.setSessionHandler(sessionHandler); Is wrong, in Jetty8 SessionManager setSessionCookie(String) was removed. Here is the answer: ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS); SessionManager sm = new HashSessionManager(); ((HashSessionManager)sm)