In my Spring Boot
1.4 based application I use Spring Session
to store session data in the database with JDBC
.
This works fine
Function cookie cannot encode properly the value with space also french signs and so on. I solve this problem with URLEncoder.encode(String arg0, Encoding version) here I used UTF-8. Here the method I created!
private static void setCookie( HttpServletResponse response, String nom, String valeur, int maxAge )throws IOException {
Cookie cookie = new Cookie( nom, URLEncoder.encode( valeur, "UTF-8" ) );
cookie.setMaxAge( maxAge );
response.addCookie( cookie );
}