Search in sources :

Example 1 with Cookie

use of org.springframework.boot.web.server.Cookie in project spring-boot by spring-projects.

the class WebSessionIdResolverAutoConfiguration method initializeCookie.

private void initializeCookie(ResponseCookieBuilder builder) {
    Cookie cookie = this.serverProperties.getReactive().getSession().getCookie();
    PropertyMapper map = PropertyMapper.get().alwaysApplyingWhenNonNull();
    map.from(cookie::getDomain).to(builder::domain);
    map.from(cookie::getPath).to(builder::path);
    map.from(cookie::getHttpOnly).to(builder::httpOnly);
    map.from(cookie::getSecure).to(builder::secure);
    map.from(cookie::getMaxAge).to(builder::maxAge);
    map.from(getSameSite(cookie)).to(builder::sameSite);
}
Also used : Cookie(org.springframework.boot.web.server.Cookie) PropertyMapper(org.springframework.boot.context.properties.PropertyMapper)

Aggregations

PropertyMapper (org.springframework.boot.context.properties.PropertyMapper)1 Cookie (org.springframework.boot.web.server.Cookie)1