In Tomcat, we can do it like this:
<Context useHttpOnly="true" sessionCookiePath="/"sessionCookieDomain=".XXXX.com"/>
I want to share the cookie for second level domain with Spring Boot, how to do it?
Settings for the server that Spring Boot embeds are available as application properties (listed here under the section # EMBEDDED SERVER CONFIGURATION
and the namespace server.servlet.session.cookie.*
).
The equivalent to the Tomcat config from above should be:
# properties in /src/resources/application.properties
server.servlet.session.cookie.domain=.XXXX.com
server.servlet.session.cookie.http-only=true
server.servlet.session.cookie.path=/