好的,我没有在配置中找到任何属性来更改它。我深入研究了Spring会话的源代码,最后做了:
@Beanpublic <S extends ExpiringSession> SessionRepositoryFilter<? extends ExpiringSession> springSessionRepositoryFilter(SessionRepository<S> sessionRepository, ServletContext servletContext) { SessionRepositoryFilter<S> sessionRepositoryFilter = new SessionRepositoryFilter<S>(sessionRepository); sessionRepositoryFilter.setServletContext(servletContext); cookieHttpSessionStrategy httpSessionStrategy = new cookieHttpSessionStrategy(); httpSessionStrategy.setcookieName("MY_SESSION_NAME"); sessionRepositoryFilter.setHttpSessionStrategy(httpSessionStrategy); return sessionRepositoryFilter;}
“ SESSION”名称是cookieHttpSessionStrategy的源中的默认设置。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)