An invalid domain [.localhost.com] was specified for this cookie

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wuzhong8809/article/details/84578993

尝试调用cookie.setDamain时,报了这个错。

使用这个文章的解决方法可以解决问题:

https://blog.csdn.net/doctor_who2004/article/details/81750713

增加一个bean

/**
     * 解决问题:
     * 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()));
    }

猜你喜欢

转载自blog.csdn.net/wuzhong8809/article/details/84578993