spring session版本升级到Bean-SR8后,每次刷新页面sessionId不一致问题
添加如下代码即可解决
@Bean public DefaultCookieSerializer getDefaultCookieSerializer() { DefaultCookieSerializer defaultCookieSerializer = new DefaultCookieSerializer(); defaultCookieSerializer.setUseBase64Encoding(false); defaultCookieSerializer.setCookieName("SESSION"); defaultCookieSerializer.setUseHttpOnlyCookie(false); defaultCookieSerializer.setSameSite(null); return defaultCookieSerializer; }
项目是spring-session + spring security,session是存入到redis
初始还以为是zuul网关配置问题,最后发现是由于spring session版本升级后导致
本文来自博客园,作者:margo,转载请注明原文链接:https://www.cnblogs.com/ZMargo/articles/11908839.html