@Configuration
public class CookieConfig {
/**
* 解决问题:
* There was an unexpected error (type=Internal Server Error, status=500).
* An invalid domain [.localhost.com] was specified for this cookie
*
* @return
*/
@Bean
public WebServerFactoryCustomizer<TomcatServletWebServerFactory> cookieProcessorCustomizer() {
return (factory) -> factory.addContextCustomizers(
(context) -> context.setCookieProcessor(new LegacyCookieProcessor()));
}
}
补充cookie坑,同一个服务器,前端访问IP地址cookie存在IP地址下,访问域名cookie存在域名下
原文地址:https://www.cnblogs.com/yxmhl/p/12237343.html
时间: 2024-11-08 09:43:05