老项目安全整改需求,这里记录一下。
修改spring application.xml系列配置文件的spring-session配置部分中的cookieSerializer如下:
<bean id="redisHttpSessionConfiguration" class="org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration">
<property name="maxInactiveIntervalInSeconds" value="7200" /> <!--session 超时时间-->
<property name="cookieSerializer">
<bean class="org.springframework.session.web.http.DefaultCookieSerializer">
<property name="useSecureCookie" value="true" />
</bean>
</property>
</bean>
重启项目,ok:

本文介绍了在老项目中对SpringApplication的spring-session配置进行安全整改,重点关注了如何修改cookieSerializer以使用SSL并设置session超时时间为7200秒的过程。
8456

被折叠的 条评论
为什么被折叠?



