parent
7cde892f4e
commit
6473ec1ba1
@ -0,0 +1,25 @@
|
|||||||
|
package com.ruoyi.framework.config;
|
||||||
|
|
||||||
|
import org.apache.tomcat.util.http.Rfc6265CookieProcessor;
|
||||||
|
import org.apache.tomcat.util.http.SameSiteCookies;
|
||||||
|
import org.springframework.boot.web.embedded.tomcat.TomcatContextCustomizer;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置cookie
|
||||||
|
* @author wu
|
||||||
|
* @since 2024/8/8 下午9:28
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class TomcatConfiguration {
|
||||||
|
@Bean
|
||||||
|
public TomcatContextCustomizer sameSiteCookiesConfig() {
|
||||||
|
return context -> {
|
||||||
|
final Rfc6265CookieProcessor cookieProcessor = new Rfc6265CookieProcessor();
|
||||||
|
// 设置Cookie的SameSite
|
||||||
|
cookieProcessor.setSameSiteCookies(SameSiteCookies.NONE.getValue());
|
||||||
|
context.setCookieProcessor(cookieProcessor);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue