Skip to content

Sample WebFlux based application to customize session cookie #1620

Closed
@eleftherias

Description

@eleftherias

We have a sample application demonstrating how to customize the cookie in a servlet based application.
We should add a sample demonstrating how to customize the cookie in a WebFlux based application.
This is a prerequisite for gh-1614.

The sample will declare a custom WebSessionIdResolver bean

@Bean
public WebSessionIdResolver webSessionIdResolver() {
	CookieWebSessionIdResolver customResolver = new CookieWebSessionIdResolver();
	customResolver.setCookieName("JSESSIONID");
	customResolver.addCookieInitializer(builder -> builder.path("/"));
	customResolver.addCookieInitializer(builder -> builder.sameSite("Strict"));
	return customResolver;
}

Metadata

Metadata

Assignees

Labels

in: docsAn issue in Documentation or samplestype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions