In the application. The yaml already configured
Server:
The servlet:
The session:
Cookie:
Secure: true
HTTP - only: true
Name: yayayayayay
And then checked the in start classes:
@ Bean
Public ServletContextInitializer ServletContextInitializer () {
Return new ServletContextInitializer () {
@ Override
Public void onStartup (ServletContext ServletContext) throws ServletException {
ServletContext. GetSessionCookieConfig (.) elegantly-named setName (" yourCookieName ");
System. The out. Println (" KKKKKKKKKK: "+ servletContext. GetSessionCookieConfig (). The getName ());
System. The out. Println (" KKKKKKKKKK: "+ servletContext. GetSessionCookieConfig () isHttpOnly ());
System. The out. Println (" KKKKKKKKKK: "+ servletContext. GetSessionCookieConfig () isSecure ());
//System. Out. Println (" KKKKKKKKKK: "+ servletContext. GetSessionCookieConfig ());
}
};
}
Output:
KKKKKKKKKK: yourCookieName
KKKKKKKKKK: true
KKKKKKKKKK: true
Then use firefox login request, how do: JSESSIONID, there is no Secure sign

CodePudding user response:
Consult the building Lord, solved the problem, can you tell me about plan, thanks