Document how to use LegacyCookieProcessor
Closes gh-6827
This commit is contained in:
@@ -772,6 +772,38 @@ HTTPS connector:
|
||||
|
||||
|
||||
|
||||
[[howto-use-tomcat-legacycookieprocessor]]
|
||||
=== Use Tomcat's LegacyCookieProcessor
|
||||
The embedded Tomcat used by Spring Boot does not support "Version 0" of the Cookie
|
||||
format out of the box, and you may see the following error:
|
||||
|
||||
[indent=0]
|
||||
----
|
||||
java.lang.IllegalArgumentException: An invalid character [32] was present in the Cookie value
|
||||
----
|
||||
|
||||
If at all possible, you should consider updating your code to only store values
|
||||
compliant with later Cookie specifications. If, however, you're unable to change the
|
||||
way that cookies are written, you can instead configure Tomcat to use a
|
||||
`LegacyCookieProcessor`. To switch to the `LegacyCookieProcessor` use a
|
||||
`TomcatContextCustomizer` bean:
|
||||
|
||||
[source,java,indent=0,subs="verbatim,quotes,attributes"]
|
||||
----
|
||||
@Bean
|
||||
public TomcatContextCustomizer customizer() {
|
||||
return new TomcatContextCustomizer() {
|
||||
|
||||
void customize(Context context) {
|
||||
context.setCookieProcessor(new LegacyCookieProcessor());
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
[[howto-use-jetty-instead-of-tomcat]]
|
||||
=== Use Jetty instead of Tomcat
|
||||
The Spring Boot starters (`spring-boot-starter-web` in particular) use Tomcat as an
|
||||
|
||||
Reference in New Issue
Block a user