我正在使用 Spring Sessions 的 v1.0.1。我已经使用 XML 配置设置了我的应用程序。我现在需要根据某些属性从默认的“SESSION”更改 cookie 名称。例如到myApp_SESSION,其中 myApp 将从属性文件中读取。
我注意到SessionRepositoryFilter只有一个构造函数,它采用sessionRepository和带有 CookieHttpSessionStrategy 的httpSessionStrategy使用默认值。
我当前的 XML 配置如下。
<bean id="mapSessionRepository" class="org.springframework.session.MapSessionRepository" />
<bean id="springSessionRepositoryFilter" class="org.springframework.session.web.http.SessionRepositoryFilter">
<constructor-arg ref="mapSessionRepository" />
</bean>
是否可以通过将 CookieHttpSessionStrategy 注入 springSessionRepositoryFilter bean 来更改 cookie 名称?