响应Cookie默认返回 SameSite=Lax
作用:不能携带cookie进行跨域post访问
所以导致 浏览器的Cookie-session 机制失效,服务端每次访问都创建新的session
解决方式
@Bean
public CookieSerializer httpSessionIdResolver()
{
DefaultCookieSerializer cookieSerializer = new DefaultCookieSerializer();
cookieSerializer.setCookieName("SESSION");
cookieSerializer.setUseHttpOnlyCookie(false);
cookieSerializer.setSameSite(null);
return cookieSerializer;
}