1.springBoot启动了继承SpringBootServletInitializer
2.重写onStartup
public class ManagerApplication extends SpringBootServletInitializer {
//去除url中含有的JSESSIONID
@Override
public void onStartup(ServletContext servletContext) throws ServletException {
super.onStartup(servletContext);
servletContext.setSessionTrackingModes(Collections.singleton(SessionTrackingMode.COOKIE));
SessionCookieConfig sessionCookieConfig= servletContext.getSessionCookieConfig();
sessionCookieConfig.setHttpOnly(true);
}
public static void main(String[] args) {
SpringApplication.run(ManagerApplication.class, args);
}
}
jsessionid没有了