I am using v1.0.1 from Spring sessions. I have set up my application using XML configurations. Now I need to change the default cookie name "SESSION" based on some property. For example, in myApp_SESSION, where myApp will be read from the properties file.
I noticed that SessionRepositoryFilter has only one constructor that accepts SessionRepository and httpSessionStrategy with CookieHttpSessionStrategy using default values.
My current XML configuration is below.
<bean id="mapSessionRepository" class="org.springframework.session.MapSessionRepository" /> <bean id="springSessionRepositoryFilter" class="org.springframework.session.web.http.SessionRepositoryFilter"> <constructor-arg ref="mapSessionRepository" /> </bean>
Is it possible to change the name of the cookie by entering CookieHttpSessionStrategy in the springSessionRepositoryFilter bean?
Anoop source share