org.springframework.web.server.session.WebSessionIdResolver Java Examples

The following examples show how to use org.springframework.web.server.session.WebSessionIdResolver. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RedisConfigure.java    From cms with Apache License 2.0 5 votes vote down vote up
@Bean
public WebSessionIdResolver webSessionIdResolver() {
    CookieWebSessionIdResolver resolver = new CookieWebSessionIdResolver();
    // 重写定义 cookie 名字
    resolver.setCookieName("able-sid");
    return resolver;
}
 
Example #2
Source File: CookieConfig.java    From spring-session with Apache License 2.0 5 votes vote down vote up
@Bean
public WebSessionIdResolver webSessionIdResolver() {
	CookieWebSessionIdResolver resolver = new CookieWebSessionIdResolver();
	resolver.setCookieName("JSESSIONID"); // <1>
	resolver.addCookieInitializer((builder) -> builder.path("/")); // <2>
	resolver.addCookieInitializer((builder) -> builder.sameSite("Strict")); // <3>
	return resolver;
}
 
Example #3
Source File: SessionConfig.java    From spring-reactive-sample with GNU General Public License v3.0 4 votes vote down vote up
@Bean
public WebSessionIdResolver headerWebSessionIdResolver() {
    HeaderWebSessionIdResolver resolver = new HeaderWebSessionIdResolver();
    resolver.setHeaderName("X-SESSION-ID");
    return resolver;
}
 
Example #4
Source File: SpringWebSessionConfigurationTests.java    From spring-session with Apache License 2.0 4 votes vote down vote up
@Bean
WebSessionIdResolver alternateWebSessionIdResolver() {
	return new HeaderWebSessionIdResolver();
}