You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
515 B
18 lines
515 B
package de.superx.spring; |
|
|
|
import java.util.function.Consumer; |
|
|
|
import org.springframework.http.ResponseCookie; |
|
|
|
/** |
|
* Setzt das SameSite-Attribut des CSRF-Cookies (XSRF-TOKEN) global auf "Lax", |
|
* analog zur Einstellung fuer das JSESSIONID-Cookie in {@link SessionCookieFilter}. |
|
*/ |
|
public class CsrfCookieSameSiteCustomizer implements Consumer<ResponseCookie.ResponseCookieBuilder> { |
|
|
|
@Override |
|
public void accept(ResponseCookie.ResponseCookieBuilder builder) { |
|
builder.sameSite("Lax"); |
|
} |
|
|
|
}
|
|
|