Skip to content

Instantly share code, notes, and snippets.

@stuartwdouglas
Created March 15, 2017 05:16
Show Gist options
  • Save stuartwdouglas/2643533b6850332054326f3fa76dcdbd to your computer and use it in GitHub Desktop.
Save stuartwdouglas/2643533b6850332054326f3fa76dcdbd to your computer and use it in GitHub Desktop.
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;
/**
* @author Stuart Douglas
*/
@WebListener
public class SessionIDChangeListener implements ServletContextListener {
@Override
public void contextInitialized(ServletContextEvent sce) {
sce.getServletContext().getSessionCookieConfig().setName("MYSESSIONID");
}
@Override
public void contextDestroyed(ServletContextEvent sce) {
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment